title: std::list copy to std::vector skipping elements
body: <p>I've run across a rather bizarre exception while running C++ code in my objective-C application.  I'm using libxml2 to read an XSD file. I then store the relevant tags as instances of the Tag class in an std::list. I then copy this list into an std::vector using an iterator on the list. However, every now and then some elements of the list aren't copied to the vector. Any help would be greatly appreciated.</p>
  
  <pre><code> printf("\n length list = %lu, length vector = %lu\n",XSDFile::tagsList.size(), XSDFile::tags.size() );
  std::list&lt;Tag&gt;::iterator it = XSDFile::tagsList.begin();
  //result: length list = 94, length vector = 0
  
  /*
  for(;it!=XSDFile::tagsList.end();++it)
  {
      XSDFile::tags.push_back(*it); //BAD_ACCESS code 1  . .  very bizarre . . . . 25
  }
  
   */
  std::copy (XSDFile::tagsList.begin(), XSDFile::tagsList.end(), std::back_inserter (XSDFile::tags));
  
  printf("\n Num tags in vector = %lu\n", XSDFile::tags.size());
  
  if (XSDFile::tagsList.size() !=  XSDFile::tags.size())
  {
      printf("\n length list = %lu, length vector = %lu\n",XSDFile::tagsList.size(), XSDFile::tags.size() );
      //result: length list = 94, length vector = 83
  }
  </code></pre>