A very simple question but yet confusing:
Why does a using directive change the inheritance!? This compiles with Comeau.
I have read that a using directive (decleration?) makes the variable public, but why?
What I want is just a nice method not to write always this->x
inside B...?
class A{
protected:
int x;
public:
};
class B: public A {
public:
using A::x;
};
int main(){
B b;
b.x = 2;
}
Thanks!