TIter it(NULL); it();

Alexander Zvyagin (zvyagin@mx.ihep.su)
Mon, 23 Feb 1998 10:27:50 GMT+03:00


IHEP, Protvino, Russia, 23-FEB-1998

Dear all!

The string
TIter it(NULL); it();
produces:
*** Break *** Segmentation violation

May be it will be good to do some internal checks in TIterator?
I think it is better to have

void better(TList *l)
{
TIter it(l);
while( TObject *o=it() )
.....
}

than

void worse(TList *l)
{
if( NULL!=l )
{
TIter it(l);
while( TObject *o=it() )
.....
}
}

better(NULL);
worse (NULL);

Alexander Zvyagin.