[xsd-users] how long is a pointer still valid when working with the data object model?

Erik Sjölund erik.sjolund at gmail.com
Fri Jan 28 10:56:14 EST 2011


Hi,
After adding an object with the help of

 void  push_back (std::auto_ptr<X>)

to a sequence class, is it afterwards still possible to use a pointer
of the added object that you might have kept?
I guess the auto_ptr indicates you should not really be doing this.

I have also been wondering how long you may assume that a pointer is
still valid after doing something like
&(someElementName().[index])

For instance if you know that you have only added things with
push_back() to a sequence class, can you then assume that pointers to
previous "siblings" are unchanged?

cheers,
Erik Sjölund



More information about the xsd-users mailing list