Towards Safety and Security in C++26
summary
C++26 will add library hardening (P3471) that inserts boundary checks with an optional quick-enforcement mode that can trap/stop execution (implementations already show pointer-tombstone behavior). It will introduce contracts (P2900) with pre/post predicates using observe/enforce/ignore semantics and some compile-time checking, and expand constant evaluation (allowing exceptions in constexpr) while requiring compilers to diagnose and refuse undefined behavior during compilation. Proposals for core safety profiles and a Rust-like borrow checker (Circle prototype) are still being discussed but are not expected for C++26.
AI-written summary · about
chapters (10)
- 0:00C++ safety and security intro
- 9:12Undefined behavior examples
- 16:58UB enables optimizations
- 21:28Constant evaluation vs UB
- 26:45Hardened stdlib in C++26
- 34:34Contracts for functional safety
- 40:43Observable checkpoints in contracts
- 45:35Core safety profiles
- 53:04Summary of C++ safety features
- 55:58Q&A on borrow checker
related talks
36mTowards Safety & Security in C++26
01h 02mTowards Correctness, Safety and Security in C++26
01h 29mC++ Safety And Security Panel 2024
01h 26mA Path to Practically Safe C++
01h 05mSecurity in C++: Hardening techniques from the trenches
01h 28mWhat C++ Needs to be Safe
01h 02mModern C++ Safety and Security At 20
01h 34mSecurity in C++ - Hardening Techniques From the Trenches
