简体   繁体   English

C ++模板/通用/元编程的最佳设置

[英]Best setup for c++ template/generic/metaprogramming

I am writing/maintaining some heavily templated code in c++. 我正在用C ++编写/维护一些大量模板化的代码。 I am currently compiling it on windows but it is getting slower to compile and harder to write. 我目前正在Windows上对其进行编译,但是编译起来越来越慢,编写起来也越来越困难。

I want to know if there are any 我想知道是否有

  1. Tools 工具
  2. Other Compilers 其他编译器
  3. Compiler Switch 编译器开关
  4. IDE IDE
  5. Practice 实践
  6. Dependency Management Technique 依赖管理技术
  7. Libraries 图书馆

on Windows/Linux that can help to work on heavily templated code more easily. 在Windows / Linux上可以帮助更轻松地处理大量模板化的代码。

i use: 我用:

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. 我对Windows没有太多经验,但是对于大量使用模板的项目,从gcc 4.x升级到gcc 4.5的速度明显更快。

Which compiler are you using now? 您现在正在使用哪个编译器? Various compilers have different quality template support and error messages. 各种编译器具有不同的质量模板支持和错误消息。 Clang and Intel tend to be pretty good; Clang和Intel往往都不错。 GCC usually prints out the necessary information but it is often hard to read. GCC通常会打印出必要的信息,但是通常很难阅读。 Visual Studio has nice formatting and is fairly compliant. Visual Studio具有良好的格式并且相当合规。 In terms of speed, GCC 4.6 is claimed to be much faster than earlier versions. 在速度方面,GCC 4.6被认为比早期版本要快得多。 You might want to download STLfilt to make the errors easier to read. 您可能需要下载STLfilt,以使错误更易于阅读。 Boost (especially Boost.MPL) is a good library for doing template metaprograms; Boost(特别是Boost.MPL)是一个很好的库,可用于执行模板元程序。 you might also want Boost.Fusion and/or Boost.Proto depending on what you are doing. 您可能还需要Boost.Fusion和/或Boost.Proto,具体取决于您正在执行的操作。

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

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