<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>masugata_k</author_name>
  <author_url>https://blog.hatena.ne.jp/masugata_k/</author_url>
  <blog_title>masugata_kの日記</blog_title>
  <blog_url>https://masugata-k.hatenadiary.org/</blog_url>
  <categories>
    <anon>C++</anon>
    <anon>プログラミング</anon>
    <anon>例外安全性</anon>
  </categories>
  <description>『代入演算子の定石』では、swap には無送出保証の例外安全性が必要だと書いた。これに対して、「これなら原子性保証だけで十分なのでは?」という疑問が湧くかもしれない。ちなみに、こういうコード: some_class&amp; operator = (const some_class&amp; another) { some_class tmp_(another); swap(tmp_); return *this; } 確かに、swap が例外を投げても (原子性保証があれば) 問題はないように見える。 実は、swap の無送出保証を要請しているのはこの代入演算子ではない。これは、このクラスをメンバ変数に持っ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmasugata-k.hatenadiary.org%2Fentry%2F20071107%2F1194439283&quot; title=&quot;swap には無送出保証の例外安全性が必要 - masugata_kの日記&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>2007-11-07 21:41:23</published>
  <title>swap には無送出保証の例外安全性が必要</title>
  <type>rich</type>
  <url>https://masugata-k.hatenadiary.org/entry/20071107/1194439283</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
