3 ms·
A “defer” statement like in Go. Would remove the need for a bunch of goto.
by deanmoriarty 6y ago
A “defer” statement like in Go. Would remove the need for a bunch of goto.
- marcodiego 6y agoI don't know if it is like in Go, but there is a defer suggestion: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2589.pdf http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2589.pdf
- stephen82 6y agoI think "defer" is coming [1], along with other goodies that simplified the life of C++ developers, but time will tell. I really hope they approve the following: * auto * constexpr * lambda function * __typeof__ used as typeof; it behaves like decltype It would lead to cleaner code without excessive macro magic; only where would be needed. [1] https://gustedt.wordpress.com/2020/12/14/a-defer-mechanism-for-c/ https://gustedt.wordpress.com/2020/12/14/a-defer-mechanism-f...