using-declaration

C++: Accessing types from dependent base classes

Does anyone know why using-declarations don't seem to work for importing type names from dependent base classes? They work for member variables and functions, but at least in GCC 4.3, they seem to be ignored for types. template <class T> struct Base { typedef T value_type; }; template <class T> struct Derived : Base<T> { // Version...

c++ using declaration, scope and access control

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 accessible information more convenient to use. However: the 'using' declaration can also be used to change access constraints (not only for functions...

Using declaration (Derived class)

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? }; int main(){} Is it because, B1::fb() is treated as B1::fb(B1*) and B2::fb() treated as B2::fb(B2*)? That is, does the implicit parameter, help in disting...