代码改变世界

加快C++编译速度四个方法

2012-03-06 15:55  shuisheng  阅读(340)  评论(0)    收藏  举报

Good practices to increase compilation speed:(加快编译速度好的做法)

  • forward declaration whenever possible (尽量前置声明)
  • precompiled headers (预编译头文件)
  • #pragma once (not standard, but both MSVC and GCC support it) (非标准, MSVC和GCC支持)
  • pimpl pattern (Private Implement pattern 私有实现模式)