compile problem with std::map::const_iterator
Lars Gullik Bjønnes
larsbj@lyx.org
Wed Oct 11 14:39:00 GMT 2000
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
More information about the Libstdc++
mailing list