The Joy of C++26 Contracts - Myths, Misconceptions & Defensive Programming - Herb Sutter @CppCon
The Joy of C++26 Contracts - Myths, Misconceptions & Defensive Programming - Herb Sutter  @CppCon
Uploaded November 2025 | Updated September 2026, 2 weeks ago
cppcon.org
---

The Joy of C++26 Contracts - Myths, Misconceptions & Defensive Programming - Herb Sutter - CppCon 2025
---

This talk is all about the C++26 contracts feature. It covers the following topics:

- Why defensive programming is a Good Thing (mainly for functional safety, but occasionally also for memory safety)
- Brief overview of C++26 contracts, and why they’re way better than C assert (spoiler: writing them on declarations, being able to use them in release builds, and language support is just way better than macros)
- The 3-page “Effective C++ Contracts book” — best practices you need to know to use them (spoiler: keep compound conditions together, don’t write side effects, understand the pros and cons of installing a throwing violation handler… that’s pretty much… it?)
- Why they’re viable, because they address the key things we need in production (which we’ll list)
- Why they’re minimal, because we actually need every part in C++26 to use them at scale (which we’ll do by systematically summarizing why each piece is necessary)
- What the future evolution of contracts holds (spoiler: virtual functions! groups/labels!)
- A review of Frequently Asked Questions

---

Slides: github.com/CppCon/CppCon2025/blob/main/Presentations/The_Joy_of_C++26_Contracts_(and_Some_Mythconceptions).pdf

Work at Hudson River Trading (HRT): tinyurl.com/safxfctf
---

Herb Sutter

Herb is a technical fellow at Citadel Securities, designer of several Standard C++ features, and chair of the ISO C++ committee and the Standard C++ Foundation. His current interest is simplifying C++.
---

CppCon is the annual, week-long face-to-face gathering for the entire C++ community. The conference is organized by the C++ community for the community. You will enjoy inspirational talks and a friendly atmosphere designed to help attendees learn from each other, meet interesting people, and generally have a stimulating experience. Taking place this year in Aurora, Colorado, near the Denver airport, and including multiple diverse tracks, the conference will appeal to anyone from C++ novices to experts.
Annual CppCon Conference - cppcon.org
linkedin.com/company/cppcon
https://x.com/cppcon
facebook.com/CppConference
reddit.com/r/cppcon
https://mastodon.social/@CppCon
---

Videos Filmed & Edited by Bash Films: BashFilms.com
YouTube Channel Managed by Digital Medium Ltd: events.digital-medium.co.uk
---

#cpp #cplusplus #cppcon #cppprogramming #cplusplusprogramming #softwaredevelopment #softwareengineering #coding #code #computerscience #technology #technews #programming #programmer
The Joy of C++26 Contracts - Myths, Misconceptions & Defensive Programming - Herb SutterLightning Talk: The UB Detector: constexpr - Andreas Fertig - CppCon 2024Making C++ Safe, Healthy, and Efficient - John Lakos - CppCon 2025Lightning Talk: The Present and Future of Cross-Platform GUI in C++ - Matt Aber - CppCon 2024Building a High-Performance Binary Serialization Format with In-Place Modification - Hamish MorrisonLightweight Operator Fusion Using Data-Centric Function Interfaces in C++ - Manya Bansal - CppConTo Int or to Uint, This is the Question - Alex Dathskovsky - CppCon 2024Lightning Talk: Back When ChatGpt Was Young And Stupid - Andrei Zissu - CppCon 2025Deciphering C++ Coroutines Part 2 - Mastering Asynchronous Control Flow - Andreas Weis - CppCon 2024Lightning Talk: From Macro to Micro in C++ - Conor Spilsbury - CppCon 2024A Pragmatic Approach to C++: Designing, Organizing and Writing Maintainable Code - Oleg RabaevLightning Talk: How Fast Isn’t You Constexpr? - Hossein GhahramanzadehAnigh - CppCon 2025
CppCon |

The Joy of C++26 Contracts - Myths, Misconceptions & Defensive Programming - Herb Sutter

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER