Part 6
Correctness
How C++ programs go wrong, and the systematic ways to stop them.
-
6.1
Exceptions
Reporting failure across call boundaries, and what unwinding costs.
-
6.2
Error handling without exceptions
Return-based error handling, and when it fits better.
-
6.3
Undefined behaviour
The contract you did not know you signed, and how the optimizer uses it.
-
6.4
Testing
Writing tests that catch regressions rather than restating the code.
-
6.5
Debugging
Finding the defect rather than guessing at it.
-
6.6
Invariants and assertions
Stating what must always be true, and checking it.