在XX公司工作第二天,维护已有代码
根據(jù)《C++ More Exception》所述的規(guī)則:
Rule #1: Never write using-directives in header files.
Rule #2: Never write namespace using-declarations in header files.
Rule #3: In implementation files, never use a using-declaration or a using-directive before #include directive.
Rule #4: Use C headers with the new style #include <cheader> instead of the old style #include <header.h>.
1.今天我把我負(fù)責(zé)的代碼全部頭文件里的using命令和聲明全部移動到實現(xiàn)文件里,并在實現(xiàn)文件里將using放置在全部頭文件的后面。
2.去除了關(guān)于std空間的前向聲明
3.給變量起了一個更好的名字
備注一下:前向聲明其它命名空間形式例如以下
namespace android{
class TouchInputMapper; (類)
template <typename T> class Singleton;(模版)
}
轉(zhuǎn)載于:https://www.cnblogs.com/gavanwanggw/p/7202569.html
總結(jié)
以上是生活随笔為你收集整理的在XX公司工作第二天,维护已有代码的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 设置多个网卡
- 下一篇: POJ 2653 Pick-up sti