简体   繁体   English

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

[英]Will modules be part of C++20 ? Will it reduce compilation time for libraries?

Hi I am full time c++ programmer with 2.5 years experience. 嗨,我是具有2.5年经验的全职c ++程序员。 I felt good about new C++14 features. 我对新的C ++ 14功能感到很好。 I use them everyday. 我每天都用它们。 However every time I compile my code it takes lot of time some time even more than 15 min. 但是,每次我编译代码时,都会花费很多时间,甚至超过15分钟。 I went through the guidelines on how to reduce compile time using Forward References, Pre-compiled headers etc.. However it still take long time to compile even for small c++ projects which I like to try some logic/new feature or a library. 我仔细阅读了有关如何使用正向引用,预编译标头等来减少编译时间的准则。但是,即使对于喜欢尝试某些逻辑/新功能或库的小型c ++项目,编译仍然需要很长时间。 I read little about modules which didn't make it to C++17. 我很少读到关于模块的信息,而这些模块并没有进入C ++ 17。 I am just curious to know will it be part of C++20 ? 我只是好奇地知道它将成为C ++ 20的一部分吗? Will it reduce compilation time ?If so by how much factor ? 它会减少编译时间吗?

From the second edition of "A Tour of C++": 摘自《 C ++之旅》第二版:

The language feature, called modules is not yet ISO C++, but it is an ISO Technical Specification [ModulesTS]. 语言功能(称为模块)尚不是ISO C ++,但它是ISO技术规范[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 . -Bjarne Stroustrup, 《 C ++之旅》,2018年6月

And while factors will vary, Dr. Stroustrup notes: 尽管因素会有所不同,但Stroustrup博士指出:

The effects on maintainability and compile-time performance can be spectacular. 对可维护性和编译时性能的影响可能是惊人的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM