嵌套类 C++
可能的重复:
C++ 嵌套类
C++ 中的嵌套类访问控制
我对什么访问有点困惑嵌套类具有封闭类的成员。它与外部类有什么关系?
Possible Duplicates:
nested classes C++
nested class access control in C++
I'm a little confused as to what access a nested class has to the members of an enclosing class. What is the relationship it shares with the outer class?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嵌套类对封闭类没有任何其他类无法使用的特殊访问权限 - 它可以看到公共成员等。嵌套仅为嵌套类提供有用的作用域机制,但不会改变其行为或能力。
The nested class does not have any special access to the enclosing class that would not be available to any other class - it can see public members, etc. The nesting only provides a useful scoping mechanism for nested class, but doesn't change its behavior or capabilities.
这可能对您有帮助:C++ 中的嵌套类访问控制。这并不完全是您所要求的,但提供了一些有趣的信息。
This might help you : nested class access control in C++. It is not exacly what you asked, but gives some interesting informations.