找回密码
 FreeOZ用户注册
查看: 1226|回复: 0
打印 上一主题 下一主题

[论坛技术] 友元使用的一个总结

[复制链接]
跳转到指定楼层
1#
发表于 17-5-2009 20:30:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?FreeOZ用户注册

x
这个总结来自C++ FAQ Lite:

14.4 友元不能被传递,不能被继承,也不是互利的
14.4 friendship isn't inherited, transitive, or reciprocal

1. I don't necessarily trust the kids of my friends.
2. I don't necessarily trust the friends of my friends.
3. You don't necessarily trust me simply because I declare you my friend.

另外应该还有一个:
你是我的朋友,但不代表你能访问我小孩的专用成员
My children doesn't necessarily trust you regarding their own properties.
回复  

使用道具 举报

您需要登录后才可以回帖 登录 | FreeOZ用户注册

本版积分规则

小黑屋|手机版|Archiver|FreeOZ论坛

GMT+10, 7-4-2025 15:37 , Processed in 0.024518 second(s), 17 queries , Gzip On, Redis On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表