Boost logo

Boost :

From: Eric Woodruff (Eric.Woodruff_at_[hidden])
Date: 2002-12-10 11:36:51


I tested a shared_ptr<void> and while it seems to be invalidating the memory
of the pointer (implying that it is deleted), the proper destructor is never
called.

"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:000701c2a066$b1a8e720$1d00a8c0_at_pdimov2...
> From: "Johan Nilsson" <johan.nilsson_at_[hidden]>
> > "David Abrahams" <dave_at_[hidden]> wrote in message
> > news:ufzt62ax6.fsf_at_boost-consulting.com...
> >
> > > Incidentally, shared_ptr<void> may allow you the kind of type erasure
> > > you want. Just a thought...
> >
> > I' afraid I don't really follow you. Wouldn't shared_ptr<void> choke on
> > trying to delete through a void pointer?
>
> No.
>
> shared_ptr<void> pv(new X);
> pv.reset(); // calls X::~X()
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk