mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 12:44:40 +03:00
book: improve NULL example (#133)
This commit is contained in:
@@ -14,7 +14,8 @@ void foo(char *);
|
||||
void foo(int);
|
||||
|
||||
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;
|
||||
if (std::is_same<decltype(NULL), decltype((void*)0)>::value)
|
||||
std::cout << "NULL == (void *)0" << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user