National standards bodies vote down C++26, and the fight over contracts may push the new version into 2027
For the first time a C++ draft has failed the penultimate ISO ballot; next week the standards committee looks for a way out in Brazil.
The new version of the C++ programming language was voted down at the end of October by the national standards bodies within ISO, the penultimate step before a standard becomes official. According to The Register and consultancy Margo, there were 13 votes in favour, 9 against and 12 abstentions, while ISO allows at most a quarter of votes to be negative. Committee member Andreas Fertig writes on his blog that, as far as he knows, this is the first time a C++ draft has failed at this stage.
The sticking point is contracts: conditions that developers can attach to functions, such as checks before and after a call or an assertion along the way, to catch errors and undefined behaviour. Language creator Bjarne Stroustrup and his allies consider the P2900 proposal rushed, too complex and insufficiently tested, The Register reports. Supporters such as Fertig argue that the feature has been debated for years and won a majority several times, and that a veto this late damages trust within the committee.
Working group WG21 meets next week in Búzios, Brazil. It could take contracts out of the text, but according to The Register that is complicated because a lot of library work already relies on them. Putting a revised version to a new vote is another option. Every option threatens to delay publication, which could mean the language ends up known as C++27.