Is it safe to #define NULL nullptr?

前端 未结 6 857
囚心锁ツ
囚心锁ツ 2021-02-02 06:38

I have seen below macro in many topmost header files:

#define NULL 0  // C++03

In all over the code, NULL and 0 are u

6条回答
  •  爱一瞬间的悲伤
    2021-02-02 06:55

    Far better is to search and replace NULL with nullptr throughout the code.

    It may be syntactically safe, but where would you put the #define? It creates code organisation problems.

提交回复
热议问题