
2 May
2011
2 May
'11
7:19 p.m.
On 5/2/2011 10:54 AM, Emil Dotchevski wrote:
Yes but how do I know not to dereference it? Dereferencing a null pointer is still undefined behavior.
I was referring to the implicit destruction mechanism; the block_ptr will not be implicitly dereferenced if its pointee is already destroyed. If the pointer is explicitly dereferenced in the destructor then this will cause undefined behavior. -Phil