Talk:cpp/language/destructor

Specify how destructors can be explicitly called
E.g. calling destructors from within of destroyed class may be not obvious:

Rutsky (talk) 01:29, 18 December 2014 (PST)


 * it's an interesting (to a wannabe language lawyer like myself) corner case, perhaps we can work in an example similar to 3.8[basic.life]p7.4 along with a mention of the effect on lifetime (and with a link to lifetime), at which time it could be mentioned what happens if is omitted. BTW, clang and gcc give helpful unused-value warnings on that . --Cubbi (talk) 08:04, 18 December 2014 (PST)

Cleanup Syntax Section
Due to historical reasons, there are 5 syntax examples but only the last one maintained along the time. Nowadays, 5th case actually includes 1st and 2nd cases, which seems redundant, and 3rd and 4th cases are incomprehensive. Does it deserve a cleanup? --Yaossg (talk) 08:57, 28 September 2022 (PDT)


 * yes, but if we just keep formal syntax 5, it's not recognizable as a destructor. How about we ensure there is an explicit shown? We could split 5 two ways: one for ~foo (class scope) and one for stuff::foo::~foo (namespace scope).  --Cubbi (talk) 09:12, 28 September 2022 (PDT)