P4332R0 — Contracts are inappropriate for undefined behavior checks
EWGSG23WG21
This document makes one narrow claim: that the mechanism P2900 defines for contract assertions is the wrong mechanism for checks whose purpose is to detect or mitigate core-language undefined behavior, as proposed by P3100. The claim does not depend on any hostile reading of contracts. It follows from what the contracts proposal says about itself: P3846R1 concedes that guaranteed enforcement is a different need from what P2900 provides, and that a portable in-code guarantee that a check is performed is not available in C++26. A check for undefined behavior that is not guaranteed to run is not a check.