How set an iterator to NULL
Michael Cieslinski
micis@gmx.de
Tue Sep 20 13:46:00 GMT 2005
Since last week this small program does no longer compile.
My question are:
Is this correct or should I file a bug report?
How is it possible to initialize an iterator to NULL?
Michael Cieslinski
<example.cpp>
#include <list>
struct S { int x; };
std::list<S>::iterator IT;
void Init()
{
IT = NULL;
}
g++ -c example.cpp
example.cpp: In function 'void Init()':
example.cpp:9: error: no match for 'operator=' in 'IT = 0l'
stl_list.h:112: note: candidates are: std::_List_iterator<S>&
std::_List_iterator<S>::operator=(const std::_List_iterator<S>&)
More information about the Gcc
mailing list