简体   繁体   English

增强的单元测试::可选

[英]unit tests for boost::optional

Where can I find the unit tests for boost::optional? 在哪里可以找到boost :: optional的单元测试?

I am trying to strip out boost::optional to own code since including all of boost slows down my compilation time massively. 我正在尝试去除boost :: optional来拥有自己的代码,因为包括所有boost会大大降低我的编译时间。

Are you referring to 你指的是

$(boost_root)\\libs\\optional\\test? $ {boost_root)\\ libs \\ optional \\ test?

Eg on my windows installation this would be 例如在我的Windows安装上,这将是

C:\\Program Files (x86)\\boost\\boost_1_47\\libs\\optional\\test C:\\ Program Files(x86)\\ boost \\ boost_1_47 \\ libs \\ optional \\ test

On a different note, have you looked at other techniques to speed up compilation times such as precompiled headers, only including the required headers, the pimpl idiom, etc. 另一方面,您是否看过其他加快编译时间的技术,例如预编译的标头,仅包括所需的标头,pimpl习惯用法等。

These can make a big difference: eg Say your class contains an instance of boost::asio::io_service, then only 这些可以产生很大的不同:例如,假设您的类包含boost :: asio :: io_service的实例,则仅

#include <boost/asio/io_service.hpp>

in your header instead of 在标题中而不是

#include <boost/asio.hpp>

and then include other files such as the place holders, etc in your source. 然后在您的源代码中包含其他文件,例如占位符等。 This made a pretty big difference to me. 这对我来说有很大的不同。 Your mileage may vary... 你的旅费可能会改变...

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

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