Pure virtual functions in C++11

前端 未结 8 2244
太阳男子
太阳男子 2020-12-29 18:46

In C++98, the null pointer was represented by the literal 0 (or in fact any constant expression whose value was zero). In C++11, we prefer nullptr

8条回答
  •  不知归路
    2020-12-29 19:40

    The = 0 syntax wasn't used to initialize a pointer, it was simply to indicate syntactically that the provided virtual was pure.

    Hence the = 0 syntax for declaring pure virtuals is unchanged.

提交回复
热议问题