C++26 is done again: contracts survive and gain an enforced label
C++26 was finished in March 2026, but five national bodies voted against the draft over contracts. At the November 2026 meeting in Búzios, Brazil, WG21 kept contracts, added an always-enforced label (P4451R2) and three other fixes, and voted 111 to 9 to reship. A second ballot comes next, then ISO publication.
C++26 has been finished twice. The committee completed its technical work in March 2026, but the Draft International Standard ballot did not pass unanimously, with five national bodies voting Disapprove mainly over contracts. At its November meeting in Búzios, Brazil, WG21 answered those comments, kept contracts, added a way to mark individual contracts as always enforced, and voted to reship. Herb Sutter's trip report has the details. If you were waiting to see whether contracts would make it into C++26 before planning around them, the answer is yes.
What happened at the meeting
About 220 people attended, around 35% in person and 65% remotely, from 27 nations. Most of the week went on national body comments from the failed ballot. According to the report, this was the first time a C++ DIS ballot failed to pass unanimously. The comments that drove the Disapprove votes were mostly about contracts: the pre and post specifiers on functions and the contract_assert statement. Several asked for contracts to be removed from C++26. The committee discussed those requests and kept the feature.
The plenary vote history shows support for shipping with contracts has grown, not shrunk:
| Vote | In favour | For–against–abstain |
|---|---|---|
| Feb 2025: merge contracts into the working draft | 87.7% | 100–14–12 |
| Mar 2026: finalize and ship C++26 | 90.5% | 114–12–3 |
| Nov 2026: reship C++26 | 92.5% | 111–9–8 |
Next, the updated document goes to a second DIS ballot and final editorial work. Sutter says it is "anticipated to be published in the near future by ISO", but gives no date.
The four changes to C++26
The committee adopted four papers into C++26. The same changes also go into the C++29 working draft.
An always-enforced label for contracts (P4451R2)
The headline change is P4451R2, "Early Adoption of an Always-Enforced Label", by Joshua Berne. It is a pure extension: it lets you mark a specific contract assertion so that, in the paper's words, "program execution will not continue past the contract assertion if it is violated, regardless of the semantics of other contract assertions."
That addresses a common objection. In the contracts design adopted in 2025 (P2900), how a contract is evaluated is chosen by the implementation, typically through build settings, so the same check might be ignored in one build and enforced in another. For checks guarding memory safety or security invariants, some reviewers wanted a guarantee in the source code. The label provides it. The report's example:
int f(int x)
pre<std::contracts::controls::enforced>(x > 0)
post<std::contracts::controls::enforced>(r : r > 0)
{
contract_assert<std::contracts::controls::enforced>(x > 0);
return x;
}The label is a template-style argument, not an attribute, and it is found by ordinary name lookup. A namespace alias or using directive therefore works, which keeps call sites readable:
namespace cc = std::contracts::controls;
void write_block(std::span<std::byte> buf, std::size_t offset)
pre<cc::enforced>(offset <= buf.size());The report says the design is forward-compatible with P3400R5, a broader proposal being considered for C++29. It also mentions Romania's P3911R2, "Make Contracts Reliably Non-Ignorable", as a paper in a similar spirit.
Reflection and modules (P4466R2)
P4466R2, by Dan Katz and Tomasz Kamiński, adds selectively transparent using declarators so reflection behaves more consistently with modules, especially the std module. It leaves room for fuller reflection of using aliases in C++29. If you plan to combine import std; with reflection-based code generation, this is the fix that makes that pairing predictable.
Allocation control in std::execution (P4453R1)
P4453R1, by Dietmar Kühl and Lucian Radu Teodorescu, gives more flexible control over memory allocation in std::execution, the senders and receivers framework. That matters most to teams with custom allocators or no-heap constraints, such as games, embedded and low-latency systems.
More structural types (P3861R1)
P3861R1, "Pragmatic approach to standard structural types", by Corentin Jabot, lets standard types such as std::string_view, std::span and std::tuple be used in more places that need structural types, including as non-type template parameters. Code that currently works around this with hand-written fixed-string types may be able to drop them.
What was adopted for C++29
Work on C++29 continued alongside. The report says five core language papers and seven library papers were adopted, and names these:
- P0085R5: octal literals with a
0oor0Oprefix, with the bare leading0deprecated for octal. - P3568R4: labeled
breakandcontinue, for leaving nested loops withoutgotoor flags. - P3411R7:
std::ranges::any_view, a type-erased view. - P3216R6:
views::slice. - P4189R0:
.get_ptr()onstd::optional.
Sutter notes that "adopted for C++29" does not mean waiting until 2029: some of these already have implementation support. He doesn't name compilers, so check your toolchain's release notes. The next full meeting is in Istanbul, Türkiye, in March.
What C++ teams should do now
- Plan on contracts being in C++26. The removal requests failed and support rose to 92.5%. If you have been holding off on a contracts adoption plan, start with assertions you already have, such as
assertcalls and precondition comments on public APIs. - Decide which checks must never be skipped. The enforced label is for invariants where continuing would be worse than stopping, such as bounds or lifetime checks guarding memory. Leave ordinary checks unlabeled so build configuration can still control them.
- Track compiler support, not the ISO date. Your usable C++26 is whatever your compilers ship, and the four Búzios changes are new. Before using the enforced label or the new structural types in shared code, confirm your GCC, Clang and MSVC versions support them.
- Watch the second ballot. Another failed ballot is possible, though the larger majority makes it less likely.
If you maintain a large C++ codebase, the mechanical part of adoption, such as converting precondition comments and assert calls into pre and contract_assert, is the kind of well-scoped refactor that can be split into small, reviewable pull requests. Agent-built changes need the same review as any other; CodeBeast, for example, runs a Review agent over each pull request before you see it, but still leaves the merge to you.
Sources
- Herb Sutter: C++26 is done (again): trip report, November 2026 ISO C++ standards meeting
- P4451R2: Early Adoption of an Always-Enforced Label
- P2900: Contracts for C++
- P0085R5, P3568R4, P3411R7, P3216R6, P4189R0
FAQ
Is C++26 finished?
Its technical work is finished for the second time. After the first Draft International Standard ballot failed over contracts, the committee addressed the comments in November 2026 and voted 111 to 9, with 8 abstentions, to reship. A second ballot and ISO publication follow, with no date given.
Are contracts still in C++26?
Yes. Several national body comments asked for contracts to be removed, and the committee rejected those requests. It instead added P4451R2, which lets you mark an individual pre, post or contract_assert as always enforced.
What does the always-enforced contract label do?
Writing pre<std::contracts::controls::enforced>(cond) guarantees that execution will not continue past that contract if it is violated, whatever evaluation semantic the build uses for other contracts. It is meant for checks where continuing after a violation would be unsafe.
When can I use C++26 features in my compiler?
When your compiler ships them, which is independent of the ISO publication date. Many C++26 features are already implemented in major compilers, but the changes adopted in Búzios are new, so check each compiler's release notes before relying on them.
Written by the CodeBeast Team with AI assistance. Spotted a mistake? Email support@codebeast.ai.