ISO C++ Chair Herb Sutter speaks at Cppcon

The ISO C++ committee (WG21) has approved the C++26 standard, described by committee member Herb Sutter as the most compelling release since C++11, and including Contracts, despite opposition to the feature from C++ inventor Bjarne Stroustrup, among others.The committee met in Croydon, London, and approved the standard on March 28. According to Sutter's report, the next stage is that the final document will be prepared and sent for international approval. C++ generally ships a new standard every three years, and the committee also adopted the schedule for C++29, on which work has already started.

Contracts are one of the major features in C++26, Sutter said. Contracts are a means of setting preconditions and postconditions on function declarations, and adding assertion statements within functions. The feature is intended to help make C++ code safer and more reliable.The paper [PDF] describing Contracts for C++26 notes that "behind the attempts to add a Contracts feature to C++ is a long and storied history." Contracts were also part of the C++20 working draft but WG21 removed them in 2019 following major changes in the proposed design.The C++26 proposal describes itself as the culmination of a plan to produce a minimum viable product for C++26. There are gaps, such as no support for contracts on virtual functions, though this is expected in a future version.