operator!= is missed for const_reverse_iterator (I've tried `map' and `multimap' classes). Compiling the code below produces an error: bug_ne.cpp: In function `int main()': bug_ne.cpp:12: error: no match for 'operator!=' in 'ri != std::map<_Key, _Tp, _Compare, _Alloc>::rend() [with _Key = int, _Tp = int, _Compare = std::less<int>, _Alloc = std::allocator<std::pair<const int, int> >]()' ///// cut_here ////// #include <map> #include <iostream> using namespace std; typedef map<int,int> M; int main() { M m; m[0] = 0; for(M::const_reverse_iterator ri=m.rbegin();ri!=m.rend();++ri) cout << ri->first << " : " << ri->second << endl; return 0; } ///// cut_here //////
Know behaviour, issue DR280 ("Comparison of reverse_iterator to const reverse_iterator") of the ISO Standard, which, however, at variance with the corresponding DR179 about iterators, is still in the 'Open' status: we can't do anything about it 'til the official resolution. Thanks for your report, Paolo.
Paolo did DR179, ever get resolved, if not can you reopen the bug and suspend it while the DR is open. Thanks, Andrew
*** Bug 13581 has been marked as a duplicate of this bug. ***
*** Bug 13627 has been marked as a duplicate of this bug. ***
I think that INVALID resolution is not suitable. In particular, it hides the bugreport from default searching. Reopen to mark it SUSPENDED...
Confirming it to ...
Suspend it.
DR279 is a "Closed Issue" now, according to http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#279 DR280 is still active, but "implementation experience" is sought: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#280
Oops, DR279 is irrelevant. I had read 279 instead of 179.
*** Bug 19562 has been marked as a duplicate of this bug. ***
The DR is now [Ready] and we can implement its straightforward resolution.
Subject: Bug 11729 CVSROOT: /cvs/gcc Module name: gcc Changes by: paolo@gcc.gnu.org 2005-10-05 15:49:39 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: stl_iterator.h libstdc++-v3/docs/html/ext: howto.html Added files: libstdc++-v3/testsuite/24_iterators/reverse_iterator: 11729.cc Log message: 2005-10-05 Paolo Carlini <pcarlini@suse.de> PR libstdc++/11729 (DR 280, [Ready]) * include/bits/stl_iterator.h: Add reverse_iterator global functions with two template parameters (operator==, !=, <, >, <=, >=, -). * testsuite/24_iterators/reverse_iterator/11729.cc: New. * docs/html/ext/howto.html: Add an entry for issue 280. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.3120&r2=1.3121 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_iterator.h.diff?cvsroot=gcc&r1=1.29&r2=1.30 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/docs/html/ext/howto.html.diff?cvsroot=gcc&r1=1.57&r2=1.58 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/24_iterators/reverse_iterator/11729.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
Fixed for 4.1.
*** Bug 24274 has been marked as a duplicate of this bug. ***
*** Bug 26887 has been marked as a duplicate of this bug. ***