According the the C++ reference STL containers were fixed in C++11 standard to take constant iterator in the erase methods. The following code would not compile in g++4.7 with c++0x enabled.
#include <vector> int main() { std::vector<int> vector; vector.push_back(0); std::vector<int>::const_iterator vectorItr = vector.begin(); vector.erase(vectorItr); } Obviously the new signatures were not implemented. Is there any information when this issue will be fixed? I could not find any respective information in the C++0x/C++11 Support in GCC article.
auto it = vector.cbegin();if you don't like the long iterator name. ;)-std=c++11cbegin(), cbegin() returns const_iterator in all cases.