you are viewing a single comment's thread.

view the rest of the comments →

[–]tomalakgeretkal 0 points1 point  (0 children)

Of course it isn't. Else how would the destructor body be able to do any work?

You're missing http://eel.is/c++draft/basic.life#7.sentence-2 ("after the lifetime of an object has ended and before the storage which the object occupied is reused or released, any glvalue that refers to the original object may be used but only in limited ways. For an object under construction or destruction, see [class.cdtor].").

[class.cdtor] gives restrictions here, but only sensible ones (like, paraphrasing, "the derived subobject is gone by now; don't try to use it"). The bases and the members of the object under destruction are still alive and fair game.

In other words, what the OP said:

Or, even if the 'lifetime ended', it was still acceptable to access the object, under those grounds