<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>E_Mattsan</author_name>
  <author_url>https://blog.hatena.ne.jp/E_Mattsan/</author_url>
  <blog_title>エンジニアのソフトウェア的愛情</blog_title>
  <blog_url>https://blog.emattsan.org/</blog_url>
  <categories>
    <anon>C++</anon>
  </categories>
  <description>デストラクタからオーバーライドされた仮想関数が呼べない - imHoリンク先のページにもあるように、C++ではでは構築時には先に派生元が構築され、破棄時には派生元が後に破棄されます。つまり、派生元のコンストラクタ/デストラクタが動いているときは派生先のオブジェクトはまだ生成されてないあるいはすでに破棄された状態になっています。このため派生元のクラスのコンストラクタ/デストラクタから派生先の仮想関数を呼び出そうとしても呼び出せないようになっています。 #include &lt;iostream&gt; class Base { public: Base() { std::cout &lt;&lt; &quot;Base::Bas…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.emattsan.org%2Fentry%2F20090614%2F1244959191&quot; title=&quot;コンストラクタ/デストラクタ内での仮想関数の振る舞い - エンジニアのソフトウェア的愛情&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>2009-06-14 14:59:51</published>
  <title>コンストラクタ/デストラクタ内での仮想関数の振る舞い</title>
  <type>rich</type>
  <url>https://blog.emattsan.org/entry/20090614/1244959191</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
