Why does an interface have a special visibility in a method due to a private inheritance?
Note that a global specifier :: is required in my derived class.
I don't understand why a method inherits some kind of visibility due to private inheritance. It's totally reasonable that Derived class doesn't have access to Control. But why doesn't it have access through a member either?
class Control
{
public:
void ModifySomething();
};
class Base : private Control
{
private:
virtual void Update( Control& i_control );
};
class Derived : public Base
{
private:
// ----------↓↓
void Update( ::Control& i_control ) override;
};
Note: I understand we could fix this by composition. But I would like to know why it's defined like that in C++. Could we break const-ness or something?