4 ms·
That sounds like a serious misunderstanding of the common use case to me. Have people on the C committee never understood the value of RAII in C++? It’s such a
by setpatchaddress 5y ago
That sounds like a serious misunderstanding of the common use case to me. Have people on the C committee never understood the value of RAII in C++? It’s such a huge safety improvement for ensuring that, for example, a mutex is unlocked — or a file closed — on early return.
- Arch-TK 5y agoThe problem with RAII is that unlike defer it requires you to have an exception mechanism. RAII and Exceptions are completely interdependant and you can't use one without the other (you're basically guaranteed leaks if you use exceptions without RAII and to implement RAII you need exceptions). It's valuable but let's not confuse it with defer which allows a great deal of safety without requiring exceptions.