Suppose I have a Base
class:
class Base {
friend SomeOtherClass;
};
And there is another (different) class that inherits from Base
:
class AnotherClass : public Base {}
Is friendship inherited as well?
In principle, a derived class inherits every member of a base class except:
* its constructor and its destructor
* its operator=() members
* its friends
So, no. Friends are not inherited.