您的位置:首页 > 编程语言

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

2017-07-18 20:35 627 查看
根据《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;(模版)

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: