lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Nov 24, 2015 at 12:23 AM, Coda Highland <chighland@gmail.com> wrote:

> C++ eventually realized this headache and added a finally construct to the language, because sometimes cleaning up requires more than just calling destructors in reverse order.

There is no finally in standard C++, and the consensus of the standard committee is it is not required [1]. Precisely because deterministic destruction makes it redundant.

finally is a Microsoft Visual C/C++ (MVC) extension to the language - not just to C++, but also to C - and it mirrors the "structured exception handling" (SEH) facility that was (still is) a feature of Windows NT, which was itself being developed in MVC, mostly in C, not C++, with SEH. That development happened in late 80's/early 90's, and was at about the same time when the C++ exception mechanism was being standardized, so it is a different mechanism.

Cheers,
V.