Tim Bailey

C++ Exceptions

Technical Report, 2005—2006


 


Description

This report was written as a resource for a series of postgraduate seminars on C++ software design (first delivered in April 2005). It is a comprehensive introduction to exception handling and exception-safe design. It describes
  • the operations that occur when an exception is thrown,
  • the interaction between exceptions and the old-style C standard error-handling functions,
  • how to design an exception class hierarchy,
  • the issues that make exception-safety non-trivial,
  • how the "resource aquisition is initialisation" idiom automates resource management,
  • and how "ScopeGuard" and its "Dismiss" operation facilitates elegant exception-safe design.


Download

Full paper [pdf] (126 kb, 10 pages)



[Tim's Homepage]