http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47628
Summary: non-compliant C++0x erase methods on STL containers Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: blelb...@cct.lsu.edu Apologizes if this has changed in the draft standard (my copy of n3092 indicates it hasn't): As of r169874, std::set<>, std::map<>, std::multiset<>, std::multimap<>, std::unordered_set<>, std::unordered_map<>, std::unordered_multiset<> and std::unordered_multimap<> have C++0x erase methods; instead of taking an `iterator' (or a range of `iterators' for some of the aforementioned containers), the GNU implementation of these containers accept a `const_iterator'. In ISO/IEC N3092, the specification of the erase() method is in [associative.reqmts] (Section 23.2.4) table 99 and [unord.req] (Section 23.2.5) table 100. I do not believe this problem affects the library in C++03/C++99 mode, as a preprocessor macro selects the old C++99/C++03 version of erase(). This is problematic in particular for std::map<>, where it can cause a call to erase() to be ambigious. I noticed this problem when compiling the Boost.Signals library (I'm a Boost developer) with a freshly built GCC 4.6.0. Please find attached a patch against trunk that fixes this problem.