C++ in 30 Minutes
Recommend:
Interesting Facts:
- Stack Overflow: How do exceptions work?
- https://stackoverflow.com/questions/18365532/should-i-pass-an-stdfunction-by-const-reference
So, the conclusion, at least for GCC on Linux: the cost is extra space (for the handlers and tables) whether or not exceptions are thrown, plus the extra cost of parsing the tables and executing the handlers when an exception is thrown. If you use exceptions instead of error codes, and an error is rare, it can be faster, since you do not have the overhead of testing for errors anymore.
References: