4 ms·
So are you saying that C++ has no plans to implement finally? (also I totally disagree that RAII is superior to finally. Finally, being lexically scoped, is fa
by retrogradeorbit 10y ago
So are you saying that C++ has no plans to implement finally?
(also I totally disagree that RAII is superior to finally. Finally, being lexically scoped, is far simpler, far shorter and far easier to understand. https://codecraft.co/2013/10/31/why-we-need-try-finally-not-just-raii/ https://codecraft.co/2013/10/31/why-we-need-try-finally-not-... )
- sandeatr 10y agoThat article does not convince me, scope guard + lambda appears to work just as well as finally, and is actually shorter(see tianyuzhu's comment) I do not know if anyone has proposed it for C++, but I would be surprised if it passed given that it doesn't accomplish much.