Skip to content

ResourcesNews

C++26 keeps contracts and heads for a second ISO vote

The ISO C++ committee refused to remove contracts after C++26 failed its approval ballot, and added an always-enforced label before trying again.

By Jason NguyenPublished 2 min read
A hand drops a paper slip into the slot of a square ballot box
Image: Illustration / Recaply

In short

  1. 01The ISO C++ committee voted 111 to 9, with 8 abstaining, to reissue C++26 with contracts still in it.
  2. 02C++26 gains one contracts change, a label that guarantees execution won't continue past a failed check, whatever the build settings.
  3. 03Herb Sutter says five national bodies raised C++26 contracts concerns for the first time and voted against the draft.

The story

The ISO C++ committee just finished C++26 for a second time, and the disputed contracts feature survived. Members voted 111 to 9, with 8 abstaining, to reissue the standard after its first approval ballot failed.

Contracts let developers state what must be true before and after a function runs. The Register reported that the feature was the main sticking point in that failed vote, which put the release timetable at risk.

Bjarne Stroustrup called contracts an existential threat

The fight reached the top of the language. In a committee paper, C++ creator Bjarne Stroustrup and his co-authors called the design "an existential threat to C++, adding complexity and bloat."

Herb Sutter, who chaired the committee until 2025, says earlier C++ approval ballots were always unanimous. This time, five national bodies raised contracts concerns for the first time and voted no. In his paper on the ballot, he argues those bodies gave Stroustrup's view more weight than the committee's 90% support.

C++26's one contracts change is an always-enforced label

The committee turned down requests to remove contracts but adopted one extension. A new label, std::contracts::controls::enforced, means a program can't continue past that check if it fails. That holds whatever mode the rest of the code was built in.

Without the label, the build still decides whether a check runs at all, committee member Mateusz Pusz explained. He also reports that no released compiler supports the label yet, and that GCC 16 rejects it.

Developers aren't convinced this settles things. The r/cpp discussion had 287 comments when we read it, and about a third of the 30 most-replied doubted the label or second vote. That's a snapshot, not a survey.

There is nothing you can put in the language spec which is not controlled by a compiler flag.

A Reddit user on r/cpp

The second C++26 ballot runs for eight weeks

The revised draft now goes to a new ballot of national bodies, which Pusz says takes eight weeks. He adds that ISO's time limit for this edition runs out at the end of 2027, which limits how many more ballots can happen.

Code that uses contracts without the label means the same as it did before the meeting. Until ISO publishes a new edition, C++23 stays the current standard.

Why it matters

A failed ballot is rare for C++, and the second vote tests whether a small fix satisfies national bodies that wanted bigger changes. Most teams won't feel it yet, since compilers follow the working draft. The gap between the C++ developers use and the standard ISO has approved could still grow.

Get Recaply Dev in your inboxFree, unsubscribe any time.

More stories