<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>zehnpaard</author_name>
  <author_url>https://blog.hatena.ne.jp/zehnpaard/</author_url>
  <blog_title>Arantium Maestum</blog_title>
  <blog_url>https://zehnpaard.hatenablog.com/</blog_url>
  <categories>
    <anon>C++</anon>
    <anon>Effective C++</anon>
  </categories>
  <description>例えばBオブジェクトがprivateデータメンバとしてAオブジェクトへのポインタを保持しているとする： class A {}; class B { private: A* pa; public: B&amp; operator=(const B&amp; rhs) { delete pa; pa = new A(*rhs.pa); return *this; } }; 上記のようなoperator=だと a = aのような自己代入が起きた時 new Aが例外を投げた時 に、すでにdeleteしたポインタをオブジェクトが持ち続けてしまい、バグの温床になる。 B&amp; operator=(const B&amp; rhs) …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fzehnpaard.hatenablog.com%2Fentry%2F2018%2F03%2F09%2F194916&quot; title=&quot;Effective C++勉強メモ: Item 11　自己への代入に気をつけよう - Arantium Maestum&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-03-09 19:49:16</published>
  <title>Effective C++勉強メモ: Item 11　自己への代入に気をつけよう</title>
  <type>rich</type>
  <url>https://zehnpaard.hatenablog.com/entry/2018/03/09/194916</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
