From f474b451e14319c05e6106a6a8477db5952ac9e3 Mon Sep 17 00:00:00 2001 From: Rholais Lii Date: Thu, 12 Apr 2018 19:22:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9C=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E6=AD=A3=E6=96=87=E6=8F=8F=E8=BF=B0=20(#13)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The source code only compares `NULL` with `0` and `nullptr`. --- book/02-usability.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/02-usability.md b/book/02-usability.md index bda1007..355d833 100644 --- a/book/02-usability.md +++ b/book/02-usability.md @@ -65,7 +65,7 @@ foo(int) is called foo(char*) is called ``` -从输出中我们可以看出,`nullptr` 与 `NULL` 与 `0` 均不相同。所以,请养成直接使用 `nullptr`的习惯。 +从输出中我们可以看出,`NULL` 不同于 `0` 与 `nullptr`。所以,请养成直接使用 `nullptr`的习惯。 此外,在上面的代码中,我们使用了 `decltype` 和 `std::is_same` 这两个属于现代 C++ 的语法,简单来说,`decltype` 用于类型推导,而 `std::is_same` 用于比较两个类型是否相等,我们会在后面 [decltype](#decltype) 一节中详细讨论。 @@ -974,4 +974,4 @@ std::cout << new_enum::value3 << std::endl 知识共享许可协议 -本书系[欧长坤](https://github.com/changkun)著,采用[知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议](http://creativecommons.org/licenses/by-nc-nd/4.0/)许可。项目中代码使用 MIT 协议开源,参见[许可](../LICENSE)。 \ No newline at end of file +本书系[欧长坤](https://github.com/changkun)著,采用[知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议](http://creativecommons.org/licenses/by-nc-nd/4.0/)许可。项目中代码使用 MIT 协议开源,参见[许可](../LICENSE)。