P3400R5 — Controlling Contract-Assertion Properties
Joshua Berne
EWG
Revisions R5Oct 2026R4Jul 2026R3May 2026
C++26 Contracts, adopted with [P2900R14], provides a framework for specifying and checking contract assertions whose behavior is controlled through implementation-defined build configurations. This paper introduces *assertion-control* *objects* — compile-time objects, composed from `constexpr` *labels*, that let developers customize contract-assertion behavior directly in C++ source code. Labels participate in independently opt-in *facets* that expose hooks to customize every aspect of contract-assertion evaluation and violation handling behavior. Accompanying Standard Library additions provide ready-made labels covering the most common use cases, while the underlying framework is designed to be extended with user-defined labels and new facets over time. The functionality enabled by this proposal is essential to the unhindered and widespread adoption of Contracts across the many domains in which C++ is used.