introduction
Zero-overhead is not zero cost, Hutter proposal one determintic-exception, but Bjarne Stroutrup is negative about it.
The origins of exception handling lie in the problems experienced managing a variety of error-handling approaches, such as C’s errno, error-states, callbacks, return codes, and return objects. In addition, it was observed that there were no really good approaches to reporting errors detected in constructors and in operators.
overview
- SjLj(setjump-longjump) It is simpler to implement but has more runtime overhead, and now is deprecated in modern compiler.
- table-based (zero-overhead)
- .eh_frame
- .gcc_except_table
reference
- https://www.quora.com/How-does-gcc-implement-C++-exception-handling
- the true assembly analysis
- .eh_frame
- .gcc_except_table
- Compiler Internals: Exceptions and RTTI. 2012. windows and Unix-like system
- C++ Exception Handling for IA-64
- C++ exceptions and alternatives.Bjarne Stroustrup
- a tour of c++, 3rd edition chapter 4.