<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>motorif</author_name>
  <author_url>https://blog.hatena.ne.jp/motorif/</author_url>
  <blog_title>motorified</blog_title>
  <blog_url>https://motorif.hatenadiary.org/</blog_url>
  <categories>
    <anon>C++</anon>
  </categories>
  <description>コンストラクタ内で例外を投げるべきではない、という主張がある。（今回は、デストラクタ内でという話ではない。念のため。） 例外を投げる可能性のある処理をコンストラクタから追い出すのが難しいケースなんて普通はそれほど無いので、基本的には素直にそうしておくとよい。さて不幸にも実際にコンストラクタ内で例外が投げられると何が起こるのか。以下のコードを見るとわかるように、実は言語的にはちょっと賢いことをしている。 #include &lt;iostream&gt; #include &lt;memory&gt; using namespace std; struct A { explicit A(const char* name…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmotorif.hatenadiary.org%2Fentry%2F20110913%2F1315920972&quot; title=&quot; コンストラクタの例外安全性とスマートポインタ - motorified&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>2011-09-13 22:36:12</published>
  <title> コンストラクタの例外安全性とスマートポインタ</title>
  <type>rich</type>
  <url>https://motorif.hatenadiary.org/entry/20110913/1315920972</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
