<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>wata_d</author_name>
  <author_url>https://blog.hatena.ne.jp/wata_d/</author_url>
  <blog_title>閑古鳥</blog_title>
  <blog_url>https://www.little-cuckoo.jp/</blog_url>
  <categories>
    <anon>C++</anon>
  </categories>
  <description>連結リストを自前で実装したときに、デストラクタがあると要素を全て削除するのが楽でいいですね。 #include &lt;iostream&gt; using namespace std; struct list { char* name; list* next; list(char* name) : name(name), next(0) {} ~list() { cout &lt;&lt; name &lt;&lt; endl; delete next; } }; void main() { list* node = new list(&quot;A&quot;); list* p = (node-&gt;next = new list(&quot;B&quot;)); …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.little-cuckoo.jp%2Fentry%2F20071102%2F1193979740&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>2007-11-02 14:02:20</published>
  <title>連結リストの要素を全て削除する</title>
  <type>rich</type>
  <url>https://www.little-cuckoo.jp/entry/20071102/1193979740</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
