The new C++ (C++0x or C++11) has an new kind of enum, an \"enum class\" where the names are scoped to the enum (among other things).
What is the difference between these two usage of using keyword: using boost::shared_ptr; and using namespace 开发者_开发百科boost;
If I want to use a member of a template base class from a template derived class, I have to bring it into scope as such:
struct level0 { virtual void foo() = 0; }; struct level1 : level0 { virtual void foo() { cout <<\" level1\" << endl; }
struct B1{ int d; void fb(){}; }; struct B2 : B1{ using B1::d; using B1::fb; int d;// why this gives error? void fb(){}// and this does not?
Typically the \'using\' declaration is used to bring into scope some member functions of base classes that would otherwise be hidden. From that point of view it is only a mechanism for making accessib