Bug 11729 - [DR280] no operator!= for const_reverse_iterator
Summary: [DR280] no operator!= for const_reverse_iterator
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.3.1
: P2 normal
Target Milestone: 4.1.0
Assignee: Paolo Carlini
URL:
Keywords:
: 13581 13627 19562 24274 26887 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-07-30 17:56 UTC by relf
Modified: 2006-03-27 17:28 UTC (History)
8 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-26 00:37:36


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description relf 2003-07-30 17:56:48 UTC
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 //////
Comment 1 Paolo Carlini 2003-07-30 19:13:13 UTC
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.
Comment 2 Andrew Pinski 2004-01-02 05:05:31 UTC
Paolo did DR179, ever get resolved, if not can you reopen the bug and suspend it while the DR is 
open.

Thanks,
Andrew
Comment 3 Paolo Carlini 2004-01-06 10:12:11 UTC
*** Bug 13581 has been marked as a duplicate of this bug. ***
Comment 4 Paolo Carlini 2004-01-09 10:43:24 UTC
*** Bug 13627 has been marked as a duplicate of this bug. ***
Comment 5 relf 2004-03-05 07:28:12 UTC
I think that INVALID resolution is not suitable. In particular, it hides the
bugreport from default searching.
Reopen to mark it SUSPENDED...
Comment 6 Andrew Pinski 2004-03-05 07:31:43 UTC
Confirming it to ...
Comment 7 Andrew Pinski 2004-03-05 07:32:03 UTC
Suspend it.
Comment 8 kenta 2004-03-22 06:56:59 UTC
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
Comment 9 kenta 2004-03-22 08:08:09 UTC
Oops, DR279 is irrelevant.  I had read 279 instead of 179.
Comment 10 Paolo Carlini 2005-01-21 11:34:29 UTC
*** Bug 19562 has been marked as a duplicate of this bug. ***
Comment 11 Paolo Carlini 2005-10-04 15:44:29 UTC
The DR is now [Ready] and we can implement its straightforward resolution.
Comment 12 GCC Commits 2005-10-05 15:49:43 UTC
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

Comment 13 Paolo Carlini 2005-10-05 15:50:45 UTC
Fixed for 4.1.
Comment 14 Paolo Carlini 2005-10-08 14:57:24 UTC
*** Bug 24274 has been marked as a duplicate of this bug. ***
Comment 15 Paolo Carlini 2006-03-27 17:28:20 UTC
*** Bug 26887 has been marked as a duplicate of this bug. ***