(C++) std::exception

February 24, 2017 · View on GitHub

 

 

 

 

 

(C++) std::exception

 

std::exception is the STL class for an exceptions.

 

std::exception is the base class of the STL exception hierarchy

 

Prefer to use a derived class of std::exception to a built-in type (like int) [1].

 

 

 

 

Examples

 

 

 

 

 

 

Reference

 

  1. Bjarne Stroustrup. The C++ Programming Language (4th edition). 2013. ISBN: 978-0-321-56384-2. Chapter 13.7. Advice. page 386: '[4] Use purpose-designed user-defined types as exceptions (not built-in types)'