在XX公司工作第二天,维护已有代码

来源:互联网 发布:js对象转json字符串 编辑:程序博客网 时间:2024/05/02 01:49

依据《C++ More Exception》所述的规则:

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.今天我把我负责的代码所有头文件中的using命令和声明全部移动到实现文件中,并在实现文件中将using放置在所有头文件的后面。

2.去除了关于std空间的前向声明

3.给变量起了一个更好的名字


备注一下:前向声明其他命名空间形式如下

namespace android{
class TouchInputMapper; (类)
template <typename T> class Singleton;(模版)
}

0 0
原创粉丝点击