implementation safe nullptr

前端 未结 3 1005
余生分开走
余生分开走 2021-01-01 00:14

I\'d like to keep my code compilable both on legacy C++ (C++ code using \"NULL\") and new C++11 standard (C++ code using \"nullptr\")

I\'m using GCC, but planning to

3条回答
  •  难免孤独
    2021-01-01 00:50

    NULL is a macro that expands to a null pointer constant. It still works just like it used to. Code that has to work with non-C++11 compilers should use NULL.

提交回复
热议问题