Urgent.News

What's breaking now, across thousands of outlets.

Tech

For the first time, a C++ standard failed to pass the national bodies

In a historic first, the C++ standard failed to pass through the national bodies for the first time. This marks a significant challenge for the widely-used programming language, which forms the backbone of numerous systems, from computer operating systems to web browsers and data storage. C++ is integral to performance-critical applications, including YouTube and many financial systems. Its ability to adapt to changing times has far-reaching implications in a world rife with software vulnerabilities.

The draft, which contained a new feature called Contracts, aimed to introduce a standardized way to enforce runtime checks, helping developers verify that arguments and return values meet certain conditions. However, the proposal faced opposition from several high-ranking members of the Working Group 21 (WG21), the committee responsible for the C++ standard, as well as multiple national bodies. These bodies abstained from voting, citing disagreements over the draft's direction.

The Contracts feature proposed the use of new keywords to replace assert macros, enabling developers to add pre and post checks to ensure function arguments and return values adhere to specific criteria. However, the implementation was riddled with complexities. Issues arose due to virtual functions, constexpr or function inlining, and the presence of compiler flags that selectively enabled or disabled enforcement.

Furthermore, there was uncertainty about how Contracts would behave when linking prebuilt libraries or when code was inlined across translation units.

One particularly contentious point was whether the compiler could elide checks due to Undefined Behavior, raising concerns about the reliability of enforcing Contracts in C++. The proposal's simplicity was undermined by these complications, leading to a debate over whether the feature was a minimal viable product capable of uniting the community or a complex, messy solution. Despite the controversy, several advocates released a statement urging for Contracts to remain in C++26.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at herecomesthemoon.net →

More in Tech

More from Wednesday 11 November →