{"width":"100%","provider_url":"https://hatena.blog","height":"190","author_url":"https://blog.hatena.ne.jp/zehnpaard/","provider_name":"Hatena Blog","blog_title":"Arantium Maestum","description":"\u4f8b\u3048\u3070B\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304cprivate\u30c7\u30fc\u30bf\u30e1\u30f3\u30d0\u3068\u3057\u3066A\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u30dd\u30a4\u30f3\u30bf\u3092\u4fdd\u6301\u3057\u3066\u3044\u308b\u3068\u3059\u308b\uff1a class A {}; class B { private: A* pa; public: B& operator=(const B& rhs) { delete pa; pa = new A(*rhs.pa); return *this; } }; \u4e0a\u8a18\u306e\u3088\u3046\u306aoperator=\u3060\u3068 a = a\u306e\u3088\u3046\u306a\u81ea\u5df1\u4ee3\u5165\u304c\u8d77\u304d\u305f\u6642 new A\u304c\u4f8b\u5916\u3092\u6295\u3052\u305f\u6642 \u306b\u3001\u3059\u3067\u306bdelete\u3057\u305f\u30dd\u30a4\u30f3\u30bf\u3092\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u6301\u3061\u7d9a\u3051\u3066\u3057\u307e\u3044\u3001\u30d0\u30b0\u306e\u6e29\u5e8a\u306b\u306a\u308b\u3002 B& operator=(const B& rhs) \u2026","type":"rich","author_name":"zehnpaard","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fzehnpaard.hatenablog.com%2Fentry%2F2018%2F03%2F09%2F194916\" title=\"Effective C++\u52c9\u5f37\u30e1\u30e2: Item 11\u3000\u81ea\u5df1\u3078\u306e\u4ee3\u5165\u306b\u6c17\u3092\u3064\u3051\u3088\u3046 - Arantium Maestum\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","published":"2018-03-09 19:49:16","url":"https://zehnpaard.hatenablog.com/entry/2018/03/09/194916","title":"Effective C++\u52c9\u5f37\u30e1\u30e2: Item 11\u3000\u81ea\u5df1\u3078\u306e\u4ee3\u5165\u306b\u6c17\u3092\u3064\u3051\u3088\u3046","version":"1.0","blog_url":"https://zehnpaard.hatenablog.com/","categories":["C++","Effective C++"]}