“Contract Programming in C++(20) (part 2 of 2)”
summary
C++20 adds concrete contract features: expects/ensures/assert attributes attach pre/postconditions and inline checks; attributes parse always and have three audit/default/axiom build modes where audit runs expensive checks and axiom is only for static reasoning. Violation handling defaults to abort but can be set at build time (not runtime). Concepts and requires clauses replace complex SFINAE for template constraints; noexcept is a binding no‑throw guarantee that forces terminate on exception; constexpr implies side‑effect‑free evaluation; move semantics require documenting post‑move invariants.
AI-written summary · about
chapters (7)
- 0:00Introduction and recap
- 1:54Implicit contracts in signatures
- 6:45C++98 features for contracts
- 14:43User-defined types and invariants
- 25:14C++11 language support
- 39:41C++20 contract attributes
- 59:30Summary and Q&A








