<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nishiohirokazu</author_name>
  <author_url>https://blog.hatena.ne.jp/nishiohirokazu/</author_url>
  <blog_title>西尾泰和のはてなダイアリー</blog_title>
  <blog_url>https://nishiohirokazu.hatenadiary.org/</blog_url>
  <categories>
    <anon>cpp</anon>
  </categories>
  <description>「勉強がてら」書いたコードを実用的な目的に使おうとする人が出るとは思わなかったので注意書きを足しておいたshared_ptrを作るについて。奥さんや光成さんに指摘してもらった内容を忘れないようにメモしておきます。この前のコードはこういう使い方をすると死にます。 int main(){ { SPM x(new MyValue(43)); cout &lt;&lt; &quot;x = x&quot; &lt;&lt; endl; x = x; } } ----- cstr with value43 x = x obj 43 refcount--, now: 0 dstr43 obj -1073741821 refcount++, now:…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnishiohirokazu.hatenadiary.org%2Fentry%2F20080630%2F1214807207&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>2008-06-30 15:26:47</published>
  <title>代入演算子を定義するときには「引数が自分自身」という罠に注意</title>
  <type>rich</type>
  <url>https://nishiohirokazu.hatenadiary.org/entry/20080630/1214807207</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
