C++23 will introduce standard library module support: Compiling 10 times faster
1 min readC++23 will introduce standard library module support: Compiling 10 times faster
C++23 will introduce standard library module support: Compiling 10 times faster.
While modules are the main selling point of C++20, unlike C++20, C++23’s standard library will also be modular.
Starting with the standard library, modules promise to improve compilation speed and the way C++ developers organize their code.
C++ is a programming language created by Danish computer scientist Bjarne Stroustrup and standardized by ISO.
The latest version of the standard was approved by ISO in December 2020 and published as ISO/IEC 14882:2020 (what we usually call C++20).
C++23 is the next version planned for this programming language, due for release in 2023, that will advance support for standard library modules and faster compilation.
Bjarne Stroustrup said the language upgrade will include a standard library module called std. With the standard library modules, “Hello World” becomes the following example:
import std:
int main(){
Std::cout<< "Hello, World!\\n";
}
According to Stroustrup, this will compile 10 times faster than #include <iostream>
the .
Modules not only improve compilation speed, but also unify the source code organization of common functions and templates.
The distinction between .h files and .cpp files disappears, and the C++ source code is radically simplified.
The final module will make a huge difference in the way developers organize their code.
Stroustrup also said that it does not want C++23 to be a major upgrade to C++ like C++11 and C++20.
Instead, C++23 should be a supplement or complete version of C++20, hoping to introduce some important features on the basis of C++20.
Stroustrup also expressed the impact of the pandemic on their plans: “It is difficult to have good design discussions virtually, and the lack of face-to-face communication is a huge obstacle for us.
As a result, features such as pattern matching, contracts, etc. will have to wait until C++26.”