3 ms·
Exceptions are part of the reason that RAII is so critical in the C++ world. I don’t think that’s quite true. You definitely want RAII with exceptions, yes, bu
by iainmerrick 8y ago
Exceptions are part of the reason that RAII is so critical in the C++ world.
I don’t think that’s quite true. You definitely want RAII with exceptions, yes, but RAII is extremely useful even without exceptions. I believe it’s common to disable C++ exceptions but still use RAII.
If you have multiple returns from a function (which can very easily happen with manual error checking) RAII is a big win.
- reificator 8y ago> You definitely want RAII with exceptions, yes, but RAII is extremely useful even without exceptions. Which is another way of saying exceptions are part of the reason for RAII.
- iainmerrick 8y agoYesssss, but, I still think that’s misleading. It’s like saying ATMs are part of the reason for cash.