MSVC’s STL Completes /std:c++20

Casey Carter

We are happy to announce that the final C++20 Standard Library features are now stabilized and available in /std:c++20 mode in both Visual Studio 2022 version 17.2 and Visual Studio 2019 version 16.11.14. This notably includes several proposals approved as Defect Reports (DRs) by the C++ Standard Committee against the C++20 Standard Library that made extensive design changes to <format> and <ranges> as recently as October 2021. You can now use the complete list of C++20 features in production in a binary compatible way with other supported language version modes.

C++20 Complete… Again??!?

We previously announced that MSVC had completed all features in C++20 for Visual Studio version 16.11.0, and that we had added the /std:c++20 option to indicate that most C++20 features were stabilized and considered production-ready. We delayed making some library features (<format>, <ranges>, and the portions of <chrono> that use <format>) available under /std:c++20 since there were substantial and important changes in the works for those features in the Standard Committee. We didn’t want to release those features in their current form and later apply changes that would break users of /std:c++20. Those features continued to be available only under /std:c++latest while the Committee finalized the changes and we implemented them.

Defect Reports

The DRs include both source and ABI-breaking changes to features in <format> and <ranges>. The amazing community of contributors that has grown up around the STL since open-sourcing has been implementing the DRs in the Visual Studio 2022 release series under /std:c++latest just as if they were C++23 features. Our plan has been to make the final result available under /std:c++20 once all the DRs are done, and then backport that work to Visual Studio 2019 to complete the C++20 story for customers who haven’t yet moved to Visual Studio 2022. We accomplished the first goal for Visual Studio 2022 17.2 Preview 2.

The backporting work went miraculously well considering that we had to merge a hundred commits from the development branch into the 16.11 release branch and get everything working without regressing that stable release series. We managed to complete the work in time to ship the 16.11 C++20 backport simultaneously with the completion of C++20 support in 17.2.

Go Ye Forth And Code

We’re happy to make these last bits of C++20 available to customers who need production stability guarantees. Please let us know about any problems or questions you have with the C++20 support in either Visual Studio 2019 version 16.11.14 or Visual Studio 2022 version 17.2, either via the STL’s GitHub issue tracker, Developer Community, or commenting below.