This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11729] New: no operator!= for const_reverse_iterator


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11729

           Summary: no operator!= for const_reverse_iterator
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: relf at os2 dot ru
                CC: gcc-bugs at gcc dot gnu dot org

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 //////


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]