Why does C++ not allow inherited friendship?

前端 未结 10 1582
终归单人心
终归单人心 2020-11-28 04:11

Why is friendship not at least optionally inheritable in C++? I understand transitivity and reflexivity being forbidden for obvious reasons (I say this only to head off sim

10条回答
  •  悲&欢浪女
    2020-11-28 04:42

    Simple logic : 'I have a friend Jane. Just because we became friends yesterday does not make all of her friends mine.'

    I still need to approve those individual friendships, and the level of trust would be accordingly.

提交回复
热议问题