mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 12:44:40 +03:00
book: remove nullptr 0L condition
This is a bug introduced in #132. Fixes #136
This commit is contained in:
@@ -53,8 +53,7 @@ void foo(char *);
|
|||||||
void foo(int);
|
void foo(int);
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
if (std::is_same<decltype(NULL), decltype(0)>::value ||
|
if (std::is_same<decltype(NULL), decltype(0)>::value)
|
||||||
std::is_same<decltype(NULL), decltype(0L)>::value)
|
|
||||||
std::cout << "NULL == 0" << std::endl;
|
std::cout << "NULL == 0" << std::endl;
|
||||||
if (std::is_same<decltype(NULL), decltype((void*)0)>::value)
|
if (std::is_same<decltype(NULL), decltype((void*)0)>::value)
|
||||||
std::cout << "NULL == (void *)0" << std::endl;
|
std::cout << "NULL == (void *)0" << std::endl;
|
||||||
|
|||||||
@@ -43,8 +43,7 @@ void foo(char *);
|
|||||||
void foo(int);
|
void foo(int);
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
if (std::is_same<decltype(NULL), decltype(0)>::value ||
|
if (std::is_same<decltype(NULL), decltype(0)>::value)
|
||||||
std::is_same<decltype(NULL), decltype(0L)>::value)
|
|
||||||
std::cout << "NULL == 0" << std::endl;
|
std::cout << "NULL == 0" << std::endl;
|
||||||
if (std::is_same<decltype(NULL), decltype((void*)0)>::value)
|
if (std::is_same<decltype(NULL), decltype((void*)0)>::value)
|
||||||
std::cout << "NULL == (void *)0" << std::endl;
|
std::cout << "NULL == (void *)0" << std::endl;
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ void foo(char *);
|
|||||||
void foo(int);
|
void foo(int);
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
if (std::is_same<decltype(NULL), decltype(0)>::value ||
|
if (std::is_same<decltype(NULL), decltype(0)>::value)
|
||||||
std::is_same<decltype(NULL), decltype(0L)>::value)
|
|
||||||
std::cout << "NULL == 0" << std::endl;
|
std::cout << "NULL == 0" << std::endl;
|
||||||
if (std::is_same<decltype(NULL), decltype((void*)0)>::value)
|
if (std::is_same<decltype(NULL), decltype((void*)0)>::value)
|
||||||
std::cout << "NULL == (void *)0" << std::endl;
|
std::cout << "NULL == (void *)0" << std::endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user