跳至正文

C++20 Modules Cheatsheet

随着 C++20 的普及,modules 这一重磅特性在主流工具链中也逐渐得到了愈发完善的支持。目前三大主流编译器中,MSVC 拥有最成熟的 modules 支持,Clang 紧随其后,gcc 也在加紧开发相关功能。另外,在构建系统方面,作为 C++ 社区内的事实标准的 CMake 元构建系统也将于下一个版本,即 CMake 3.28 中,发布稳定的 modules 支持。基于目前的情况,我制作了一份有关 C++20 modules 的 cheatsheet,欢迎大家参考。如有任何错误、过时之处欢迎指出。

Cheatsheet 链接如下:https://lancern.xyz/cpp20modules/ 。由于 cheatsheet 可能会随时更新,建议您在一段时间没有查阅后重新从前述链接内获得 cheatsheet 的最新版本。

With the broader acceptance of C++20, major toolchains are providing more mature support for C++20 modules. At this moment, among the 3 major C++ compilers, MSVC provides the most refined support for modules, followed by Clang, and gcc is still catching up. Besides, the de-facto C++ build system CMake will provide stable C++ modules support since its next release version (CMake 3.28). Thus, I have made a cheatsheet about C++20 modules for your reference. If you find any mistakes or out-of-date information in the cheatsheet, please let me know.

Here is the cheatsheet: https://lancern.xyz/cpp20modules/ . It’s recommended that you get the latest copy of the cheatsheet regularly because the cheatsheet may get updated at any time.

标签:

发表回复