[xsd-users] use of auto_ptr

Boris Kolpackov boris at codesynthesis.com
Wed Apr 4 05:02:56 EDT 2007


Hi Guy,

Guy Kroizman <kroiz at hyperroll.com> writes:

I've CC'ed xsd-users to my reply. Please do the same in your future
posts.

> I would prefer to get a naked pointer and deciding my self how to
> handle it.

If we always returned naked pointers then it would be impossible to
write exception-safe code using XSD. Because it is a common consensus
that exception-safe code is a good thing, we cannot make this change
just to satisfy a minority that does not care about exception safety.

After all, it is just an extra call to release() to get rid of auto_ptr:

foo_t* f = foo ("foo.xml").release ();


[The rest of the original post follows for context.]

> but I also understand the design consideration that since I did not
> do "new" I could forget to delete it.
> and by using auto_ptr I am receiving explicit ownership.
> anyway thanks for the explanation.


hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070404/e7e838c2/attachment.pgp


More information about the xsd-users mailing list