Is a namespace required when referring to the base class
问题 I have code like this: namespace N { class B { public: virtual void doStuff(B *) = 0; }; } // not in a namespace class Derived : public N::B { public: void doStuff(B *); // Should this be N::B, or is B ok? }; Do I need the namespace qualifier where Derived refers to it's base class? GCC and MSVC are happy with the code as written, but another compiler complains unless I put the namespace in. What does the C++ standard say? 回答1: Inside the class definition B is OK. That's the so-called