Logo

Blog


Why is C++23 called 23?

First, if you haven't heard the good news, C++23 was finally published by ISO. Looking at how I (and others) name this C++ standard raises the question: Why call it 23 when ISO published the standard in 2024?

Why I'm going to tell you now is how things are. Whether it is good as it is is a totally different question that I can't answer or change.

With the upcoming of C++11, WG21 decided to create new standards on something like a release train model. Since 2011, you have received a new C++ standard every three years. Behind such a standard is not only a lot of work but also planning. You can see it very much like any other software project. The project plan and, with it, all the deadlines are maintained in P1000.

This is the work WG21 does, and we have a name for each standard, with the year equal to the planned release year. So far, we have successfully released a new standard in the planned year.

Using C++23 as an example, WG21 finished its part in February 2023 and handed the document over to ISO shortly after that. We have now moved on to standardize C++26. But of course, since C++26 is built upon 23, we often reference the earlier standard, especially when adding missing functionality. Without a stable number, following a paper trail would be way harder.

The full name ISO uses is ISO/IEC 14882:2024, with the year encoded after the colon. However, they also note that this is the seventh version of this document. So, one alternative naming scheme could be 14882 rev 7. Now imagine selecting the C++ standard on the command line -std=14882-r7.

Speaking for me, that wouldn't be an improvement. However, as WG21, ISO also has a naming scheme, which says when they published the standard.

A third party is involved as well: your compiler and tooling vendors. Speaking for myself again, I wouldn't want them to wait for ISO to publish the official document before implementing the new features. They don't do that, luckily. For a temporary phase they have their own naming scheme. The vendors often start implementing features soon after they have been added to the latest draft after a WG21 meeting. But technically, this is neither C++NN nor ISO/IEC 14882:20NN. This is why you might know compiler switches like -std=c++2b, which was an alias for C++23.

Once they consider their support stable and WG21 publishes a new standard, they flip that alias to the official notation -std=c++23. Please note that this is not standardized; it is just a common agreement among vendors. Microsoft, for example, did it differently in the past, and they still have a switch called latest.

I hope that gave you an insight into how interesting naming can be. But you already know that from naming your functions and variables :-)

Andreas