c++11: erase using a const_iterator
问题 I believe that since C++11, the erase function of most containers (e.g. std::vector ) accepts a const_iterator as parameter: iterator erase (const_iterator position); Still my compilers (GCC 4.8 and Clang 3.2, both using GCC libstdc++) won't allow me to use such function, even when compiling with --std=c++11 . Is it a compiler/libstdc++ bug, or did I do something bad? This is a sample code: #include <vector> int main( ) { std::vector<int> v; v.push_back( 1 ); v.push_back( 2 ); v.push_back( 3