Home >

Better Code with C++26 Contracts

Ben Saks - EOC 2026

Better Code with C++26 Contracts
Ben Saks

Design by Contract (DbC) is a software development approach that aims to improve the reliability and maintainability of your code. Under DbC, a function explicitly states what it expects from its caller (preconditions) and what it will guarantee to its caller (postconditions).

C and C++ programmers following DbC have traditionally used assertions as a primitive way to enforce function contracts. C++26 makes DbC much easier by adding function contracts as a full-fledged language feature.

This session explains the intended uses for C++26 contracts and how they improve on traditional assertions. It covers several key areas:

  • Capturing information about contract violations at run time, with or without halting the program.
  • Clear dos and don’ts for writing effective, high-performance contracts.
  • Strategies to prepare your current codebase for contracts if your toolchain doesn’t yet support the C++26 standard.
M↓ MARKDOWN HELP
italicssurround text with
*asterisks*
boldsurround text with
**two asterisks**
hyperlink
[hyperlink](https://example.com)
or just a bare URL
code
surround text with
`backticks`
strikethroughsurround text with
~~two tilde characters~~
quote
prefix with
>

No comments or questions yet. Will you be the one who will break the ice?

OUR SPONSORS & PARTNERS