{"provider_url":"https://hatena.blog","version":"1.0","description":"\u4ed6\u30af\u30e9\u30b9\u306b\u5bfe\u3057\u3066 \u201c\u30e1\u30f3\u30d0\u95a2\u6570\u5358\u4f4d\u3067\u306e\u30a2\u30af\u30bb\u30b9\u5236\u9650\u201d \u3092\u5b9f\u73fe\u3059\u308b\u30a4\u30c7\u30a3\u30aa\u30e0\u3002 template <class T> class Passkey { friend T; Passkey() {} }; class A; class B; class C { public: // \u30af\u30e9\u30b9A\u306b\u5bfe\u3057\u3066\u306e\u307f\u516c\u958b void mfA(Passkey<A>, int arg); // \u30af\u30e9\u30b9B\u306b\u5bfe\u3057\u3066\u306e\u307f\u516c\u958b void mfB(Passkey<B>, int arg); }; class A { public: void f(C& c) { c.mfA({}, 1); // OK c.mfB({}, 2); \u2026","url":"https://yohhoy.hatenadiary.jp/entry/20240402/p1","height":"190","provider_name":"Hatena Blog","author_url":"https://blog.hatena.ne.jp/yohhoy/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20240402%2Fp1\" title=\"Passkey Idiom - yohhoy\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"yohhoy","blog_title":"yohhoy\u306e\u65e5\u8a18","type":"rich","image_url":null,"categories":["C++"],"blog_url":"https://yohhoy.hatenadiary.jp/","published":"2024-04-02 00:00:00","title":"Passkey Idiom","width":"100%"}