C++ exceptions have a runtime overhead, because they have to set up a handler (insert a record into a linked list) upon entering the try block and remove it when leaving the try block. Now of course checking return values introduces a lot of branches, so go figure out which one of them is worse...
still it is very advisable to have likely pragmas around if conditions that check return values.
The big problem with exceptions is that it introduces a lot of implicit code paths, and lots of possibilities for resource leaks (if raw pointers are involved).
That's one way they can be implemented, but now they tend to be zero-cost implementation where only when an exception occurs does it figure-out where it was and what to do.
the article speaks about 'embedded' systems - these are not x84-64 systems (intel cpus need too much power) so they don't have a 'zero cost' exception table (that is also not exactly zero cost)
Can you show me an embedded system with zero cost exceptions?
still it is very advisable to have likely pragmas around if conditions that check return values.
The big problem with exceptions is that it introduces a lot of implicit code paths, and lots of possibilities for resource leaks (if raw pointers are involved).