The result of the C++26 DIS ballot

Hacker News by 10 min read 72x views
The result of the C++26 DIS ballot

Share Post

C++26 unsuccessful its DIS ballot. As far as I know, it is the archetypal C++ outline to neglect one. Robert Seacord, the convenor of the C committee, wrote that he doesn’t think any tongue norm from SC22 has ever failed its ballot before, and Daveed Vandevoorde, a associate of the WG21 Direction Group (P5000R1), wrote that no before C++ outline got equal a sole vote against. So reflection, std::execution, archive hardening, and contracts are all in a outline that ISO hasn’t approved, and nobody knows yet how lengthy the postpone volition be.

The ballot closed on 23 October 2026, and Robert Seacord, the convenor of the C committee, posted the result on LinkedIn the next day:

Where I stand#

I kept this sequence neutral during the ballot was open and didn’t desire to shove anyone toward either side. The ballot is over, so I can say anywhere I stand.

I affection contracts as an idea, and I have missed them since they were removed from C++20. I have always cared concerning API design, concerning libraries, fine interfaces, and frameworks, and that is also why I am in LEWG. My reasons for liking contracts arrive from that experience. Checking is one benefit, and a fine one: the program can verify its own assumptions. The second axis, which I care concerning fair as much, is documentation. A precondition or a postcondition in the signature records the intent of the API designer, so users cognize what to anticipate and how to use the function, and a documentation scheme specified as Doxygen or cppreference.com can display it correct there. A comment can say the identical thing, but nothing keeps it true. It can drift distant from the code without anyone noticing. A agreement is part of the code. The compiler checks it together alongside the function, and whenever the checks are enabled, a infringement fails loudly, so this records can’t quietly go stale. Concepts already provision us the two for the types a function accepts, at compile time. Contracts are the part that is motionless missing, the one that does the identical for the values at run time. I would affection to see contracts in the standard, and it is a pity they didn’t create it this time. My penchant is to keep them. If the scheme comes out improved since of this, that is a fine outcome too.

This isn’t an theoretical inquiry for me. I have started instruction C++26 contracts in my workshops, and mp-units uses the C++26 version.

The numbers#

Part 2 explained the two conditions a DIS has to meet. The outline missed the two of them:

ConditionRequirementResult
Votes in favor, from the voting (P-)membersat smallest two-thirds12 of 20, which is 60%
Negative votes, from all bodies that votedno additional than 25%9 of 22, which is 41%

Two-thirds of 20 needs 14 votes in favor, and the outline got 12. A fourth of 22 allows five negative votes, and the outline got nine. Either one solitary would have unsuccessful the draft.

Which countries voted, and how#

The authoritative outcome names all country. Nine voted No: Denmark, Finland, Iran, Italy, Japan, Luxembourg, Romania, Spain, and Sweden. Each of them sent comments alongside its vote. France and Ireland abstained but additionally sent comments, so 11 countries commented in total. Poland and the United States abstained. I am a associate of the Polish national body.

The comments themselves aren’t accessible yet. The ISO/IEC Directives (clause 2.6.5 of Part 1) require a complete study inside 12 weeks of the vote’s end, including the result, the commission chair’s decision, and the complete content of the comments. For a ballot that closed on 23 October, this is mid-January 2027 at the latest. At the committee-draft stage, WG21 published that benevolent of study as N5028. I don’t cognize if it volition do the identical this time.

Poland’s abstention#

Poland’s stance on C++ is decided in a specialized commission of the Polish Committee for Standardization, KT 331. Its ballot asked whether Poland should refuse the DIS and dispatch technical comments to ISO. The ballot didn’t pass, so Poland told ISO “Abstention”, and no specialized comments could go alongside it.

I won’t portion the count or say who voted how. This is an inner vote, and I don’t cognize whether it may be published. A few votes decide whether Poland says item or nothing at all.

It nearly came to nothing for a distinct reason. A few days before the Polish ballot closed, we were motionless missing votes for a quorum, and without a quorum there would have been no Polish position. Some of the group on the catalog had changed jobs. I tried to attain the quiescent ones by email and on LinkedIn, and several of the emails bounced, most apt since the addresses belonged to former employers.

Whichever way you think C++26 should have gone, two things follow:

  • If you are on a national committee, vote. The ballot counts no matter which way you mold it.
  • If you can no longer obtain part, ask to be removed from the catalog of voting members. The quorum counts you, so an idle associate makes it harder for everyone alternatively to attain one, in this ballot and in all one that follows. The commission agency can’t merely eliminate person who has gone quiet, so it depends on the associate to ask.

What the No votes were about#

I am convinced the No votes were concerning contracts. That is anywhere the opposition was on document before the ballot. Both objections explained at the Croydon plenary that sent C++26 to the ballot were about contracts. Several national-body comments on the commission outline asked to eliminate them (part 2 has the table). P4238R1 asked the national bodies to ballot No complete the contracts scheme and how it advanced through the committee. I anticipate all nine No votes to be concerning contracts, and we volition cognize for certain lone whenever the comments are published.

For readers who have not followed the series, this is the feature, and part 1 explains it in detail:

#include <cmath>  double checked_sqrt(double x)  pre (x >= 0.0)  post (r : r >= 0.0) {  const double root = std::sqrt(x);  contract_assert(!std::isnan(root));  return root; }

This code doesn’t decide whether all of those checks runs or what happens whenever one of them fails. The outline defines four evaluation semantics, ignore, observe, enforce, and quick-enforce, and leaves the choice between them to the implementation. In GCC 16, you choice one alongside a compiler flag. Much of the disagreement is concerning this choice, whether a agreement assertion is a inspect the build may autumn or a justify the program can depend on (part 3). Part 4 and part 5 shield the remainder of it.

What happens next#

The directives provision four courses of act following a unsuccessful DIS:

  • circulate a revised enquiry draft, alongside an eight-week ballot alternatively of twelve,
  • circulate a revised commission outline for comments,
  • circulate it as a outline specialized specification instead,
  • cancel the project.

The SC22 place chooses among the archetypal three, in collaboration alongside the SC22 secretariat and the WG21 convenor, and in consultation alongside the ISO/IEC chief office. Canceling is the lone one that SC22 as a entire has to decide. WG21’s part is to location the comments, propose a course, and, if needed, prepared a revised draft. When I wrote this, I had seen no notice of which one they chose.

The next WG21 gathering is in Búzios, Brazil, from 16 to 21 November 2026. It volition be the first meeting of the entire commission since the result, and opinions on what it should do are divided:

  • Some desire WG21 to search another ballot without changing or removing contracts. P4433R0 is a formal proposal for this. It additionally asks WG21 to refuse comments that call for elimination unless they bring new specialized information, and to verify the two alongside a study in Búzios.
  • Others say the short-term answer is simple. J. Daniel Garcia, among the authors of P4238R1, wrote under Seacord’s post: “the abbreviated term resolution is simple, eliminate one problematic characteristic and the rest of the norm can extremely apt be approved”. Vandevoorde’s advice “will be to remove contracts from the draft, alongside adjustments to keep archive hardening”.
  • Some of the before national-body comments asked for a specialized specification or a pale paper instead.

I would akin to see a scheme in Búzios, and it is not adequate for me if it lone says what to do with contracts. If they have to depart C++26 so the remainder can ship, that is a pity, but I can live with it. I would not akin everything alternatively to delay alongside them. I would akin to see the remainder of C++26 ship as shortly as possible.

A harder inquiry is how the scheme improves from here. The objections I have peruse item in different directions: stronger guarantees checked by the compiler, additional of the scheme in the library, a specialized specification first, checks that can’t be switched off. I have not seen a single substitute that all of those who entity would accept, so I discover it difficult to say which one change would fulfill everyone. That is how I see it, and I may be wrong.

Until a new type is published, the current C++ norm is motionless ISO/IEC 14882:2024 (C++23).

What it method for your code today#

Compilers execute features from the operating draft, and the ballot doesn’t alter what they already ship. GCC 16 accepts -std=c++26, and Clang has -std=c++2c. GCC 16 implements contracts as part of its experimental C++26 support, and the Clang implementation hasn’t been merged. Whether vendors keep all drafted characteristic under that emblem is up to all of them, and nobody can commitment it today.

If your squad already uses C++26 features, or is learning them, nothing have to be undone yet. However, what your compiler implements today is a draft, and it may not equivalent the published standard.

What is motionless open#

  • the content of the comments from the 11 countries that sent them,
  • what WG21 recommends in Búzios, which way of act is chosen, and on what schedule.

I anticipation the compilers keep implementing C++26 contracts, any the commission decides next. One objection is the deficiency of manufacturing and deployment experience, and part 5 presents the two sides of that argument. This cognition is difficult to acquire without implementations that group can use, which is a chicken-and-egg problem. I would fairly not see the identical exception arrive rear the next time contracts are voted on.

I volition update this part whenever additional data is published.

Other Article Hacker News
↑
Close Right Ads
Close Left Ads