World Congress 2026 Europe • Jul 9, 2026 • Session details

Programming with Contracts in C++26

Peter Bindels

C++26 Contracts replace risky assert macros with explicit, compiler-enforced function boundaries. Learn how to trap errors at the source and achieve zero-overhead performance.

Pause
Mute Enter Fullscreen
#1 about 3 min

The limitations of code comments for function boundaries

Exploring a mathematical function to demonstrate why standard code comments hide critical bounds from compilers.

#2 about 2 min

Syntax and boundary checks of C++26 contracts

Applying preconditions and postconditions on function declarations allows compilers to assume exact bounds.

#3 about 2 min

Contracts as guardrails for intended application execution

Design bounds do not alter normal execution but catch unintended code paths before they can be exploited.

#4 about 2 min

Handling contract violations through traps and termination

The compiler standard provides handler functions passing violation objects to trigger debuggers, logging, or process termination.

#5 about 2 min

Delaying process termination in mission-critical applications

Terminating failing processes automatically is not appropriate in strict safety contexts like algorithmic trading or self-driving cars.

#6 about 2 min

Semantic modes for managing variable contract checks

The C++ standard allows switching contract enforcement paths between ignore, observe, enforce, and quick enforce.

#7 about 2 min

Deciding between contract semantic evaluation modes

Standard code should apply enforce mode, utilizing observe for deployments and quick enforce for extreme security.

#8 about 3 min

Recognizing the functional limitations of legacy C asserts

The standard assert macro breaks on unparenthesized commas and often degrades in release builds by hiding functional drift.

#9 about 2 min

Fixing ad-hoc validation problems with contract asserts

Deploying contract assert establishes safe checks that parse accurately without actively hindering system performance thresholds.

#10 about 5 min

Enabling global optimization through local contract analysis

Structured declarations assist compilers in pruning unneeded runtime checks by successfully tracking local data flow.

#11 about 3 min

Adding labels and custom messages to contract checks

Future standard updates will introduce labeled error string configurations to trigger conditional violation routing handlers.

#12 about 2 min

Checking early compiler support for C++26 contracts

Access standard implementations today using early versions of GCC 16, Clang forks, and Ubuntu package managers.

Matching moments

6:32 min

Enforcing architectural design boundaries via automated code tests

Bartosz Pietrucha · WWC 2022

3:56 min

Improving the developer experience with mainstream programming languages

Arthur Breitman Arthur Breitman +2 · WWC 2024

4:53 min

Security vulnerabilities and the challenges of immutable code

Tim Weingärtner · LIVE

2:37 min

Addressing the complaints about JavaScript as a programming language

Sasha Shynkevich · LIVE

5:22 min

Debugging contract logic within VS Code

Liu Xiaohui · LIVE

2:05 min

Implementing modern language feature advancements carefully alongside readability

Bjarne Stroustrup · WWC 2022

Upcoming sessions on this topic

Open session

World Congress 2026 North America

When Humans Stop Writing Code: Rethinking Languages, Compilers, and Responsibility

Simon Auer

Organizer of flutter vienna meetup and CEO of marqably

Simon Auer
Open session

World Congress 2026 North America

From Guesswork to Governance: Data Contracts Bring API Discipline to Apache Kafka

Sandon Jacobs

Senior Developer Advocate at IBM

Sandon Jacobs
Open session

World Congress 2026 North America

Merging at Scale: From Broken Builds to Green Mainline

Preetam Dwivedi, Manjari Akella

Preetam Dwivedi
Manjari Akella
Open session

World Congress 2026 North America

There's no dark factory without better software verifiers

Dexter Horthy

Co-Founder, HumanLayer

Dexter Horthy
Open session

World Congress 2026 North America

Secure-by-Inclusion: Preventing Accessibility Barriers from Becoming Security Vulnerabilities

Radostina (Ina) Tsvetkova

Norwegian Directorate of Labour and Welfare (NAV), Senior Advisor in Digital Accessibility and Inclusive Design

Radostina (Ina) Tsvetkova
Open session

World Congress 2026 North America

Don’t kill my Vibes - Simple Steps to Stay Secure when Vibe Coding

Isaac Evans

Co-founder & CEO of Semgrep

Isaac Evans