Skip to content

Commit f474b45

Browse files
Rholaischangkun
authored andcommitted
fix: 修复未更新的正文描述 (changkun#13)
The source code only compares `NULL` with `0` and `nullptr`.
1 parent 2038e5f commit f474b45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/02-usability.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ foo(int) is called
6565
foo(char*) is called
6666
```
6767

68-
从输出中我们可以看出,`nullptr``NULL``0` 均不相同。所以,请养成直接使用 `nullptr`的习惯。
68+
从输出中我们可以看出,`NULL` 不同于 `0``nullptr`。所以,请养成直接使用 `nullptr`的习惯。
6969

7070
此外,在上面的代码中,我们使用了 `decltype``std::is_same` 这两个属于现代 C++ 的语法,简单来说,`decltype` 用于类型推导,而 `std::is_same` 用于比较两个类型是否相等,我们会在后面 [decltype](#decltype) 一节中详细讨论。
7171

@@ -974,4 +974,4 @@ std::cout << new_enum::value3 << std::endl
974974
975975
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="知识共享许可协议" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/80x15.png" /></a>
976976
977-
本书系[欧长坤](https://github.com/changkun)著,采用[知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议](http://creativecommons.org/licenses/by-nc-nd/4.0/)许可。项目中代码使用 MIT 协议开源,参见[许可](../LICENSE)。
977+
本书系[欧长坤](https://github.com/changkun)著,采用[知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议](http://creativecommons.org/licenses/by-nc-nd/4.0/)许可。项目中代码使用 MIT 协议开源,参见[许可](../LICENSE)。

0 commit comments

Comments
 (0)