Pure virtual functions in C++11
问题 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 instead. But this doesn't work for pure virtual functions: struct X { virtual void foo() = nullptr; }; Why does this not work? Would it not make total sense? Is this simply an oversight? Will it be fixed? 回答1: Because the syntax says 0 , not expression or some other non-terminal matching nullptr . For all the time only 0 has worked. Even 0L would