Skip to content

Latest commit

 

History

History
7 lines (4 loc) · 374 Bytes

File metadata and controls

7 lines (4 loc) · 374 Bytes

条款08:优先选用nullptr,而非0NULL

nullptr 的类型为 std::nullptr_t ,并且在循环定义下, std::nullptr_t 的定义被指定为 nullptr 的类型。std::nullptr_t 可以隐式转化到所有裸指针类型,无法转换为整型。

对于 0NULL ,优先选用 nullptr

避免在整型和指针类型之间重载。