Visual C++ 2008 Fix of Containers Swap Bug

The C++ standard, specifies in the paragraph 23.1.10 that swapping two containers should not invalidate any references, pointers or iterators refering to the elements of the containers being swapped. Unfortunatelly, that is not the case of the VC++ 2005 implementation. Imagine the following case: std::vector vec1; vec1.push_back(1); vec1.push_back(2); vec1.push_back(3); std::vector vec2; vec2.push_back(10); vec2.push_back(20); std::vector::iterator it1 = vec1.begin(); … Read more