c++ 的最佳设置模板/通用/元编程
我正在用 C++ 编写/维护一些高度模板化的代码。我目前正在 Windows 上编译它,但是编译速度越来越慢并且编写起来越来越困难。
我想知道 Windows/Linux 上是否有任何
- 工具
- 其他编译器
- 编译器切换
- IDE
- 实践
- 依赖管理技术
- 库
可以帮助更轻松地处理大量模板化的代码。
I am writing/maintaining some heavily templated code in c++. I am currently compiling it on windows but it is getting slower to compile and harder to write.
I want to know if there are any
- Tools
- Other Compilers
- Compiler Switch
- IDE
- Practice
- Dependency Management Technique
- Libraries
on Windows/Linux that can help to work on heavily templated code more easily.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我使用:
-O0 -Wall -g
boost::mpl: :print
是上帝的礼物BOOST_MPL_ASSERT_MSG
i use:
-O0 -Wall -g
boost::mpl::print
is a god's giftBOOST_MPL_ASSERT_MSG
如果可能,请升级您的编译器。我对 Windows 没有太多经验,但是对于 大量使用模板。
If possible, upgrade your compiler. I don't have much experience with Windows, but the upgrade from gcc 4.x to gcc 4.5 is noticeably faster for projects that make heavy use of templates.
您现在使用哪个编译器?不同的编译器有不同质量的模板支持和错误消息。 Clang 和 Intel 往往都相当不错; GCC 通常会打印出必要的信息,但通常很难阅读。 Visual Studio 具有良好的格式并且相当兼容。在速度方面,GCC 4.6 据称比早期版本快得多。您可能需要下载 STLfilt 以使错误更易于阅读。 Boost(尤其是Boost.MPL)是一个很好的模板元程序库;您可能还需要 Boost.Fusion 和/或 Boost.Proto,具体取决于您正在做什么。
Which compiler are you using now? Various compilers have different quality template support and error messages. Clang and Intel tend to be pretty good; GCC usually prints out the necessary information but it is often hard to read. Visual Studio has nice formatting and is fairly compliant. In terms of speed, GCC 4.6 is claimed to be much faster than earlier versions. You might want to download STLfilt to make the errors easier to read. Boost (especially Boost.MPL) is a good library for doing template metaprograms; you might also want Boost.Fusion and/or Boost.Proto depending on what you are doing.