I need some quick clarification about the using
keyword regarding classes since I'm not sure I understand it correctly.
Let's say I have the following example:
class B {
public:
int var;
int f(void);
};
class C : public B {protected: using B::var; };
Does that mean that instead of inheriting the variable var
as public
from class B, class C instead inherits this variable as protected
and the only public variable left will be the int f(void);
?
Also, could the class C inherit the variable as private by having private: using B::var;
inside its body?
And is there any point of writing public: using B::var;
since the variable var is already public inside class B?
Thanks!