报错如下:no matching function for call to ‘std::vector<TYPE>::erase(__gnu_cxx::__normal_iterator<const int*, std::vector<TYPE> >&)’
v.erase(e);
原因:g++未实现这个接口,但c++11标准定义了这个接口,算编译器bug。g++4.9.0修正。
详情:
1、接口定义如下,参见http://www.cplusplus.com/reference/vector/vector/erase/
iterator erase (const_iterator position);
iterator erase (const_iterator first, const_iterator last);
2、bug反馈如下,参见https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54577
Bug 54577
- deque<T>::erase() still takes iterator instead of const_iterator
|
|
|