AlgoMaster Logo

Standard Exceptions (std::exception hierarchy)

Last Updated: May 17, 2026

11 min read

The C++ standard library ships with a small family of exception classes rooted at std::exception. Throwing one of these instead of a raw int or a hand-rolled string gives every catch site a single, predictable interface to work with: a what() method that returns a description. The hierarchy also splits problems into two useful categories, bugs you could have caught earlier and failures that depend on the world outside your code.

Premium Content

Subscribe to unlock full access to this content and more premium articles.