From 056ea33f6d4019777fe438497d3771cc8dc8e6ae Mon Sep 17 00:00:00 2001 From: huihut Date: Sun, 28 Oct 2018 12:48:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20Google=20C++=20Style=20Gui?= =?UTF-8?q?de?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ac5cc3e..83dda14 100644 --- a/README.md +++ b/README.md @@ -1178,7 +1178,7 @@ class doSomething(Flyable *obj) // 做些事情 ### Effective C++ 1. 视 C++ 为一个语言联邦(C、Object-Oriented C++、Template C++、STL) -2. 尽量以 `const`、`enum`、`inline` 替换 `#define`(宁可以编译器替换预处理器) +2. 宁可以编译器替换预处理器(尽量以 `const`、`enum`、`inline` 替换 `#define`) 3. 尽可能使用 const 4. 确定对象被使用前已先被初始化(构造时赋值(copy 构造函数)比 default 构造后赋值(copy assignment)效率高) 5. 了解 C++ 默默编写并调用哪些函数(编译器暗自为 class 创建 default 构造函数、copy 构造函数、copy assignment 操作符、析构函数) @@ -1217,6 +1217,8 @@ class doSomething(Flyable *obj) // 做些事情 ### Google C++ Style Guide +> 英文:[Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) +> 中文:[C++ 风格指南](https://zh-google-styleguide.readthedocs.io/en/latest/google-cpp-styleguide/contents/)
Google C++ Style Guide 图 ![Google C++ Style Guide](images/GoogleCppStyleGuide.png)