This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


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

compile problem with std::map::const_iterator



tested on libstdc++-v3 as of 
Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.97/specs
gcc version 2.97 20001001 (experimental)       

#include <map>
 
int main()
{
        typedef std::map<void *, void *> Cache;
 
        Cache cache;
 
        for (Cache::const_iterator cit = cache.begin();
             cit != cache.end(); ++cit) {
                ;
        }
}                          

This does not compile.

[larsbj@lett test]$ g++ -W -Wall -O2 -o testmap testmap.C
testmap.C: In function `int main()':
testmap.C:10: no match for `std::_Rb_tree_iterator<std::pair<void *const, void
   *>, const std::pair<void *const, void *> &, const std::pair<void *const,
   void *> *> & != std::_Rb_tree_iterator<std::pair<void *const, void *>,
   std::pair<void *const, void *> &, std::pair<void *const, void *> *>'    

If I change to use Cache::iterator it compiles.

Unsure if this is user,compiler or lib problem...

        Lgb

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