Boost logo

Boost :

Subject: Re: [boost] [exception] warning about non-virtual destructor - resolution?
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2012-04-15 11:17:46


On Sunday 15 April 2012 12:34:07 Olaf van der Spek wrote:
> On Sun, Apr 15, 2012 at 10:54 AM, Andrey Semashev
>
> <andrey.semashev_at_[hidden]> wrote:
> > Using a separate implementation of checked_delete in shared_ptr is what I
> > had in mind. And this implementation should not be public, I think.
>
> Isn't the type guaranteed to be complete when shared_ptr calls delete?

No. The deleter is initialized at the shared_ptr construction and you can
initialize shared_ptr with a pointer allocated somewhere else. At the point of
shared_ptr construction the type may be incomplete.


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