logo       

NULL pointers and None type: msg#00184

programming.swig

Subject: NULL pointers and None type

Hi,

Have a small problem here:
I've built an iterator:

class Iterator
{
public:
Iterator(CObject &O);
void Next(void);

CObject * Obj;
};

inline Iterator::Iterator(CObject &O) {Obj = &O;}

inline void Iterator::Next(void) {Obj = Obj->Next;}


That's fine:
but then I would like to be able to feed it a NULL pointer or a None statement so that Obj would just point to NULL.
>> I = Iterator(None)

I guess I could test before feeding the iterator anything, just wondering if there was a solution?

Any ideas???
Thanks

Alex

--
----------------------------
Alexander L. Tournier, PhD
Cancer Research UK
Lincoln's Inn Fields
LONDON
Tel: 0207 269 3583
Fax: 0207 269 3258


_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise