
15 Apr
2012
15 Apr
'12
3:17 p.m.
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@gmail.com> 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.