AlgoMaster Logo

Standard Exceptions (std::exception hierarchy)

Medium Priority21 min readUpdated June 6, 2026

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: a what() method that returns a description. The hierarchy also splits problems into two useful categories: bugs that could have been caught earlier, and failures that depend on the world outside the code.

Premium Content

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