Error Handling & Safety
Write robust C++ code with proper error handling — exceptions, RAII safety guarantees, sum types, and defensive programming patterns. Panicking is optional, though traditional.
Exceptions & Error Strategies
Exceptions: throw, try, catch
Understand the C++ exception mechanism — stack unwinding, the standard exception hierarchy, custom exceptions, and when to prefer exceptions over error codes.
Exception Safety Guarantees
Learn the three levels of exception safety — basic, strong, and no-throw — and how RAII and copy-and-swap provide them.
Error Handling Strategies: Choosing the Right Approach
Compare exceptions, error codes, and std::expected — learn when each approach is appropriate and how to handle errors in constructors, destructors, and multithreaded code.
Type Safety & Defensive Programming
std::optional, std::variant & std::expected
Use C++17/23 sum types to represent nullable values, type-safe unions, and value-or-error returns — eliminating entire classes of bugs at compile time.
Type Safety, Assertions & Contracts
Leverage the C++ type system to prevent bugs at compile time — strong enums, the newtype pattern, static_assert, runtime assertions, and the upcoming contracts feature.
Understanding & Avoiding Undefined Behaviour
Learn what undefined behaviour is, why it exists, how compilers exploit it for optimisation, and how to detect it with sanitisers and compiler warnings.