Skip to content

Modern Approaches to Error Handling ​

Error handling is a core problem every C++ programmer has to face — C-style error codes can be ignored, exceptions are restricted in embedded environments, and bare pointers have unclear semantics for representing "no value." Modern C++ provides type-safe alternatives such as optional, variant, and expected. In this chapter we review the evolution of error handling, master the scenarios where each approach fits, and close with a scenario-based selection guide.

Chapter Contents ​

pdf-latest-4-g85128cc · 85128cc · 2026-10-05