This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How set an iterator to NULL


Michael Cieslinski wrote:

>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?
>
>  
>
A patch was recently submitted specifically to stop this working, as it
shouldn't.

there isn't a general way of setting iterators to NULL (some people
believe there should be). The usual things to say are either a) don't
create the iterators until you have somewhere to point them, or b) often
(but not always) it is natural to use the iterator returned by
list.end() as a "NULL" iterator.

Chris


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