3 ms·
As I mentioned in another comment, it seems almost identical to Boost.ScopeExit, [0] but with the special restriction that it causes statements to run at the po
by MaxBarraclough 7y ago
As I mentioned in another comment, it seems almost identical to Boost.ScopeExit, [0] but with the special restriction that it causes statements to run at the point a function returns. From the article: it does not care about lexical scopes.
edit Looking at the implementation, it seems to use setjmp/longjmp on some platforms. Nasty. I believe Boost.ScopeExit does some macro trickery to leverage C++'s RAII, which isn't so bad.
[0] https://www.boost.org/doc/libs/1_72_0/libs/scope_exit/doc/html/index.html https://www.boost.org/doc/libs/1_72_0/libs/scope_exit/doc/ht...