|
From: Alvin T. <al...@th...> - 2002-08-23 21:17:29
|
hello,
try compiling the following program:
#include <iostream>
#include <stdlib.h>
#include <map>
int main(int argc, char *argv[])
{
map<int,void*> m;
map<int,void*>::iterator it;
// <fill map here>
it=m.erase(it); // erase current item and get next item - COMPILER
ERROR?
system("PAUSE"); return 0;
}
this program should be perfectly legal, yet it generates a compiler
error? it compiles fine with VC++. am i doing something wrong?
the error:
10 C:\projects\DevCpp\stl-test\main.cpp
no match for `_Rb_tree_iterator<pair<const int,void *>,pair<const
int,void *> &,pair<const int,void *> *> & = void'
185 C:\Dev-Cpp-beta5\include\g++-3\stl_tree.h
candidates are: struct _Rb_tree_iterator<pair<const int,void
*>,pair<const int,void *> &,pair<const int,void *> *> &
_Rb_tree_iterator<pair<const int,void *>,pair<const int,void *>
&,pair<const int,void *> *>::operator =(const
_Rb_tree_iterator<pair<const int,void *>,pair<const int,void *>
&,pair<const int,void *> *> &)
any help would be greatly appreciated.
thanks,
alvin
|