C++ friend inheritance?

前端 未结 4 1966
野趣味
野趣味 2020-12-14 14:22

Does a subclass inherit, the main class\' friend associations (both the main class\' own and other classes friended with the main class)?

Or to put it differently, h

4条回答
  •  没有蜡笔的小新
    2020-12-14 15:16

    Friendship is not inherited in C++.

    The standard says (ISO/IEC 14882:2003, section 11.4.8):

    Friendship is neither inherited nor transitive.

提交回复
热议问题