Is friendship inherited in C++?

后端 未结 3 1108
[愿得一人]
[愿得一人] 2021-02-07 12:54

Suppose I have a Base class:

class Base {
    friend SomeOtherClass;
};

And there is another (different) class that inherits from

3条回答
  •  醉梦人生
    2021-02-07 13:01

    No it isn't, as documented here: http://www.parashift.com/c++-faq-lite/friends.html#faq-14.4

提交回复
热议问题