c++ - 模块会成为 C++20 的一部分吗?它会减少库的编译时间吗?

标签 c++ build compilation c++20

您好,我是一名拥有 2.5 年经验的全职 C++ 程序员。我对 C++14 的新特性感觉很好。我每天都用它们。然而,每次我编译我的代码时,都会花费很多时间,有时甚至超过 15 分钟。我阅读了有关如何使用前向引用、预编译 header 等减少编译时间的指南。但是,即使对于我喜欢尝试一些逻辑/新功能或库的小型 c++ 项目,编译仍然需要很长时间。 我很少读到没有进入 C++17 的模块。我只是想知道它会成为 C++20 的一部分吗?它会减少编译时间吗?如果是的话,减少多少?

最佳答案

摘自《C++ 之旅》第二版:

The language feature, called modules is not yet ISO C++, but it is an ISO Technical Specification [ModulesTS]. Implementations are in use, so I risk recommending it here even though details are likely to change and it may be years before everybody can use it in production code. -- Bjarne Stroustrup, A Tour of C++, June 2018.

虽然因素会有所不同,但 Stroustrup 博士指出:

The effects on maintainability and compile-time performance can be spectacular.

关于c++ - 模块会成为 C++20 的一部分吗?它会减少库的编译时间吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51239144/

相关文章:

c++ - SetWindowsHookEx DLL卸载

c++ - QThread 中的槽和信号

c++ - 树的高度的复杂性

c++ - qmake:等同于源/cpp 文件的 INCLUDEPATH?

java - 使用java代码以编程方式创建android应用程序

c++ - 项目符号 2.81 : Unable to find installed header?

c++ - 在固定大小的数组上展开 C++ 中的循环是否有用?

构建 LLVM 耗尽了我所有的 RAM

java - Maven 全新安装 : cannot find symbol

c++ - 当前对象的引用存储在内存中的什么位置?