Systems Error Handling, std::expected, and Sanitizers
Eliminate runtime exceptions in performance-critical code: exception safety guarantees, zero-overhead std::expected (C++23), std::optional, and Address/Thread Sanitizers.
Class design and templates
Command of exception safety contracts, zero-overhead C++23 std::expected, std::optional, and dynamic sanitizers.
Read in order, or jump to what you need.
Every lesson builds on the one before it. Open any lesson to read the explanation, run the examples, and try the practice challenges.
- 09.01Exception Safety Guarantees: Basic, Strong, and No-throw Contracts4 min
Analyze the four levels of exception safety contracts: No-throw (noexcept), Strong (commit-or-rollback), Basic (no leaks, valid invariants), and No Guarantee.
- 09.02Zero-Overhead Error Handling: std::expected and Functional Monads4 min
Master C++23 std::expected for deterministic, exception-free systems programming: monadic chaining (and_then, or_else), value-or-error representations, and typed error enums.
- 09.03Nullable Value Semantics: std::optional and In-Place Storage4 min
Model optional presence cleanly: std::optional<T>, nullopt sentinels, value_or defaults, monadic operations, and zero-allocation in-place storage.
- 09.04Dynamic Analysis: AddressSanitizer, UndefinedBehaviorSanitizer, and Valgrind4 min
Detect systems vulnerabilities at runtime: AddressSanitizer (-fsanitize=address), UBSan (-fsanitize=undefined), ThreadSanitizer, shadow memory, and Valgrind Memcheck.
Ready to move on?
Build exception-free monadic error pipelines and run test suites under AddressSanitizer.
Open the module self-check