
2012/9/3 Dave Abrahams <dave@boostpro.com>
on Tue Aug 28 2012, Andrzej Krzemienski <akrzemi1-AT-gmail.com> wrote:
1. According to the standard, an object is considered destroyed (its life-time has ended) when its destructor *starts*. Even if it throws an exception, it is considered destroyed, so accessing its members (in order to check for the invariant) may be illegal (an undefined behavior).
It's not undefined behavior. The members and bases are not yet destroyed. Otherwise, how would you release any resources held in mmebers?
Perhaps I am being imprecise. What I mean is that at the time the invariant would be executed, the exception would have "left" the destructor of the derived class, so members and bases would have been destroyed. Regards, &rzej