This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
How set an iterator to NULL
- From: "Michael Cieslinski" <micis at gmx dot de>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 20 Sep 2005 15:46:29 +0200 (MEST)
- Subject: How set an iterator to NULL
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>&)