C++ 26 is already taking shape, says Herb Sutter

C++ 26 is already taking shape, says Herb Sutter

Herb Sutter, chair of the ISO C++ standards committee and native languages architect at Microsoft, has posted about progress towards C++ 26, promising “a huge release for concurrency and parallelism,” among other changes.

C++ versions are named by their year of release and follow a three-year cycle. The committee met in Varna, Bulgaria, and online, with nearly 180 members, and formally adopted the schedule for C++ 26, which Sutter said was “the same as the schedule for C++23 but just with three years added everywhere.” The last date for new language features “that we have not seen before” is in the third quarter of 2024, and feature freeze is first quarter 2025.

The committee adopted 40 “change papers,” said Sutter, though the proposed new features so far are mainly low key. Support for the _ character as a wildcard is added, and @, $, and ` are to be added to the basic character set (as has been done for C23).  

Hazard pointers are heading for C++ 26. A hazard pointer is one where “only the owner of the hazard pointer can set its value, while any number of threads may read its value.” This will not be a revolution for C++ safety though. “Hazard pointers matter if you are writing lock-free concurrent data structures and you need a way to handle deferred reclamation after a node delete. It is a very exotic problem to have and it is hardly a ‘very common source of memory safety issue’,” said a dev on Hacker News.

Sutter said that “the concurrency and parallelism subgroup are still on track to move forward with std::execution and SIMD parallelism for C++26,” which will be big features for concurrent programming.

While Sutter seems keen to emphasize the steady progress of C++ standards, there is also enthusiasm for new languages in the same space. Microsoft CTO Mark Russinovich recently declared that “it’s time to halt starting any new projects in C/C++ and use Rust for those scenarios where a non-GC language is required. For the sake of security and reliability. the industry should declare those languages as deprecated.” Another potential rival to C++ is Google’s experimental Carbon project; while Sutter himself offers the experimental cppfront saying that: “My goal is to explore whether there’s a way we can evolve C++ itself to become 10x simpler, safer, and more toolable.” The cppfront language was presented by Sutter at CppCon in late 2022.

A problem, though, with new languages is the vast amount of existing code which will never be ported, which means that improving C++ can still be worthwhile, even for those who take the view that it has inherent flaws or is over-complicated.