显然,这种基于键的访问保护模式:
class SomeKey {
friend class Foo;
SomeKey() {}
// possibly non-copyable too
};
class Bar {
public:
void protectedMethod(SomeKey); // only friends of SomeKey have access
};
该内容尚未被命名,因此我想为它找一个好的名称,以便我们能够简单地提到它。有什么建议吗?
它应该是:
- 简洁明了
- 表达访问保护的意图
- 最好暗示不需要代理 (?)