[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

auto_ptr ? (was Re: I'm back)

Peter Burns writes:
 > Has anybody had any experience using auto_ptr? Is it worth using? Is there
 > any thing different in using
 > an auto_ptr compared to a normal pointer?

No but, but I have used a home-made replacement class.  It's
nice because it will do all the garbage collection you need
_if_ you program data is structured into a heirarchy or set
of heirarchies (i.e tree, not graph).  Many objects may hold
pointers to a given object, but only one may be its *parent*
(the parent will hold the auto_ptr).

Since I beleive this heirarchical structure is good practice anyway,
I don't mind this restriction.  (Adrian refrains from ranting about