Collectionの中身を調査する。

The collections are also available under site.collections, with the metadata you specified in your _config.yml (if present) and the following information:

Variable Description
label The name of your collection, e.g. my_collection.
docs An array of documents.
files An array of static files in the collection.
relative_directory The path to the collection’s source directory, relative to the site source.
directory The full path to the collections’s source directory.
output Whether the collection’s documents will be output as individual files.

JekyllのCollectionは site.collections に全て格納されるらしいので、 格納されているデータを調査した。

ただし、 docsfiles は量が多いのでひとつだけ出力するようにしている。

{{site.collections[0].label | inspect }}
{{site.collections[0].docs[0]  | inspect }}
{{site.collections[0].files[0] | inspect }}
{{site.collections[0].relative_directory | inspect }}
{{site.collections[0].direcotory | inspect }}
{{site.collections[0].output | inspect }}

"docs"

{ "content": "<h2 id=\"maincpp\">main.cpp</h2>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"cp\">#include &lt;iostream&gt;\n</span>\n<span class=\"k\">template</span><span class=\"o\">&lt;</span><span class=\"k\">typename</span> <span class=\"n\">T</span><span class=\"o\">&gt;</span>\n<span class=\"k\">class</span> <span class=\"nc\">C</span><span class=\"p\">{</span>\n\n <span class=\"k\">public</span><span class=\"o\">:</span>\n <span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n <span class=\"o\">~</span><span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n\n <span class=\"kt\">void</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n <span class=\"kt\">void</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n<span class=\"p\">};</span>\n\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Fx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n <span class=\"n\">Gx</span><span class=\"p\">();</span>\n<span class=\"p\">}</span>\n\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Gx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n\n<span class=\"kt\">int</span> <span class=\"n\">main</span><span class=\"p\">(</span><span class=\"kt\">int</span> <span class=\"n\">argc</span><span class=\"p\">,</span> <span class=\"k\">const</span> <span class=\"kt\">char</span> <span class=\"o\"></span> <span class=\"n\">argv</span><span class=\"p\">[])</span>\n<span class=\"p\">{</span>\n\n <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"n\">c</span><span class=\"p\">;</span>\n\n <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Fx</span><span class=\"p\">();</span>\n\n <span class=\"k\">return</span> <span class=\"mi\">0</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n</code></pre></div></div>\n\n<p>こんなソースコードで<code class=\"highlighter-rouge\">Explicit specialization of ‘Gx’ after instantiation</code>って怒られた。</p>\n\n<p>テンプレート特殊化の際には、関数の中で特殊化した関数を呼び出す時は、\n先に呼び出す関数を記述してあげないといけない。</p>\n\n<h2 id=\"maincpp-1\">main.cpp</h2>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"cp\">#include &lt;iostream&gt;\n</span>\n<span class=\"k\">template</span><span class=\"o\">&lt;</span><span class=\"k\">typename</span> <span class=\"n\">T</span><span class=\"o\">&gt;</span>\n<span class=\"k\">class</span> <span class=\"nc\">C</span><span class=\"p\">{</span>\n\n <span class=\"k\">public</span><span class=\"o\">:</span>\n <span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n <span class=\"o\">~</span><span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n\n <span class=\"kt\">void</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n <span class=\"kt\">void</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n<span class=\"p\">};</span>\n\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Gx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Fx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n <span class=\"n\">Gx</span><span class=\"p\">();</span>\n<span class=\"p\">}</span>\n\n\n\n<span class=\"kt\">int</span> <span class=\"n\">main</span><span class=\"p\">(</span><span class=\"kt\">int</span> <span class=\"n\">argc</span><span class=\"p\">,</span> <span class=\"k\">const</span> <span class=\"kt\">char</span> <span class=\"o\"></span> <span class=\"n\">argv</span><span class=\"p\">[])</span>\n<span class=\"p\">{</span>\n\n <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"n\">c</span><span class=\"p\">;</span>\n\n <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Fx</span><span class=\"p\">();</span>\n\n <span class=\"k\">return</span> <span class=\"mi\">0</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n</code></pre></div></div>\n\n<p>これならコンパイルが通る。FxとGxの実装順番を変えただけ。</p>\n\n<h2 id=\"output\">output</h2>\n\n<div class=\"highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>Fx\nGx\n</code></pre></div></div>\n", "output": "<!DOCTYPE html>\n<html lang=\"ja\">\n <head>\n <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n \n <meta name=\"keywords\" content=\"C++,genelic,programming,template,meta\">\n\n\n <title>Explicit specialization of “ after instantiation</title>\n\n <!– bootstrap and jQuery include –>\n <link rel=\"stylesheet\" href=\"https://leico.github.io/TechnicalNote/css/style.css\">\n <script type=\"text/javascript\" src=\"https://leico.github.io/TechnicalNote/js/jquery-3.1.1.min.js\"></script>\n <script type=\"text/javascript\" src=\"https://leico.github.io/TechnicalNote/js/bootstrap/bootstrap.min.js\"></script>\n <!– bootstrap and jQuery include –>\n\n <!– MathJax include –>\n <script type=\"text/javascript\" src=\"https://leico.github.io/TechnicalNote/js/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML\"></script>\n\n <!– Google Analytics –>\n <script>\n (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,’script’,’https://www.google-analytics.com/analytics.js’,’ga’);\n \n ga(‘create’, ‘UA-100782315-1’, ‘auto’);\n ga(‘send’, ‘pageview’);\n </script>\n\n <!– Atom feed –>\n <link type=\"application/atom+xml\" rel=\"alternate\" href=\"https://leico.github.io/TechnicalNote/atom.xml\" title=\"TechnicalNote\" />\n</head>\n\n\n <body>\n <div class=\"container\">\n <div class=\"row\">\n\n\n <div class=\"col-md-8\">\n\n <header class=\"page-header\">\n <h1>Explicit specialization of “ after instantiation</h1>\n <div class=\"row\">\n\n <div class=\"col-6\">\n <dl class=\"dl-horizontal\">\n <dt>created</dt>\n <dd>2016-09-13</dd>\n <dt>last change</dt>\n <dd>2017-03-06 00:13:17 +0000</dd>\n </dl>\n </div>\n\n <div class=\"col-6 text-right\">\n <a href=\"https://twitter.com/share\" class=\"twitter-share-button\">Tweet</a>\n <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?’http’:’https’;if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+’://platform.twitter.com/widgets.js’;fjs.parentNode.insertBefore(js,fjs);}}(document, ‘script’, ‘twitter-wjs’);</script>\n </div>\n\n </div>\n </header>\n\n <div class=\"row\">\n\n <div class=\"col-12\">\n <h2 id=\"maincpp\">main.cpp</h2>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"cp\">#include &lt;iostream&gt;\n</span>\n<span class=\"k\">template</span><span class=\"o\">&lt;</span><span class=\"k\">typename</span> <span class=\"n\">T</span><span class=\"o\">&gt;</span>\n<span class=\"k\">class</span> <span class=\"nc\">C</span><span class=\"p\">{</span>\n\n <span class=\"k\">public</span><span class=\"o\">:</span>\n <span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n <span class=\"o\">~</span><span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n\n <span class=\"kt\">void</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n <span class=\"kt\">void</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n<span class=\"p\">};</span>\n\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Fx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n <span class=\"n\">Gx</span><span class=\"p\">();</span>\n<span class=\"p\">}</span>\n\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Gx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n\n<span class=\"kt\">int</span> <span class=\"n\">main</span><span class=\"p\">(</span><span class=\"kt\">int</span> <span class=\"n\">argc</span><span class=\"p\">,</span> <span class=\"k\">const</span> <span class=\"kt\">char</span> <span class=\"o\"></span> <span class=\"n\">argv</span><span class=\"p\">[])</span>\n<span class=\"p\">{</span>\n\n <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"n\">c</span><span class=\"p\">;</span>\n\n <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Fx</span><span class=\"p\">();</span>\n\n <span class=\"k\">return</span> <span class=\"mi\">0</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n</code></pre></div></div>\n\n<p>こんなソースコードで<code class=\"highlighter-rouge\">Explicit specialization of ‘Gx’ after instantiation</code>って怒られた。</p>\n\n<p>テンプレート特殊化の際には、関数の中で特殊化した関数を呼び出す時は、\n先に呼び出す関数を記述してあげないといけない。</p>\n\n<h2 id=\"maincpp-1\">main.cpp</h2>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"cp\">#include &lt;iostream&gt;\n</span>\n<span class=\"k\">template</span><span class=\"o\">&lt;</span><span class=\"k\">typename</span> <span class=\"n\">T</span><span class=\"o\">&gt;</span>\n<span class=\"k\">class</span> <span class=\"nc\">C</span><span class=\"p\">{</span>\n\n <span class=\"k\">public</span><span class=\"o\">:</span>\n <span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n <span class=\"o\">~</span><span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n\n <span class=\"kt\">void</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n <span class=\"kt\">void</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n<span class=\"p\">};</span>\n\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Gx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Fx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n <span class=\"n\">Gx</span><span class=\"p\">();</span>\n<span class=\"p\">}</span>\n\n\n\n<span class=\"kt\">int</span> <span class=\"n\">main</span><span class=\"p\">(</span><span class=\"kt\">int</span> <span class=\"n\">argc</span><span class=\"p\">,</span> <span class=\"k\">const</span> <span class=\"kt\">char</span> <span class=\"o\"></span> <span class=\"n\">argv</span><span class=\"p\">[])</span>\n<span class=\"p\">{</span>\n\n <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"n\">c</span><span class=\"p\">;</span>\n\n <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Fx</span><span class=\"p\">();</span>\n\n <span class=\"k\">return</span> <span class=\"mi\">0</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n</code></pre></div></div>\n\n<p>これならコンパイルが通る。FxとGxの実装順番を変えただけ。</p>\n\n<h2 id=\"output\">output</h2>\n\n<div class=\"highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>Fx\nGx\n</code></pre></div></div>\n\n </div>\n\n <div class=\"col-12\">\n <hr>\n <a href=\"https://twitter.com/share\" class=\"twitter-share-button\">Tweet</a>\n <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?’http’:’https’;if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+’://platform.twitter.com/widgets.js’;fjs.parentNode.insertBefore(js,fjs);}}(document, ‘script’, ‘twitter-wjs’);</script>\n </div>\n\n </div>\n\n </div>\n \n <div class=\"col-md-4\">\n <h2>\n <a href=\"https://leico.github.io/TechnicalNote/\">\n Technical Note\n </a>\n </h2>\n\n \n\n \n\n <h3>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp\">C++ Top</a>\n </h3>\n\n \n <h3>C++11 Tips</h3>\n <ul>\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/template-template-parameter\">テンプレートテンプレートパラメータまとめ</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/is-same-base-of\">std :: is_same と std :: is_base_of の挙動を調べる</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/private-using\">using や typedef にもアクセス指定子が乗る</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/enum-class-operator\">enum class 同士の計算を僕も実装してみた</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/template-specialize-inherit\">クラステンプレートの特殊化ごとに継承元を変更する</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/variadic-template\">可変引数テンプレートパラメータいろいろ</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/using_error\">std :: conditional の判定式でエラー</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/cast_specialization\">テンプレート型変換演算子を特殊化する</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/has_trivial_assign\">has_trivial_assign は is_trivially_copy_assignable になった</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/lambda\">ラムダ式を利用する</a>\n </li>\n\n \n </ul>\n \n <h3>Tips</h3>\n <ul>\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/overload-cast\">キャスト演算子のオーバーロード</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/accessor\">アクセサ</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/Explicit-specialization-of-after-instantiation\">Explicit specialization of “ after instantiation</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/part-of-specialize\">特定のメンバ関数だけ特殊化</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/template-specialization\">テンプレート特殊化の入り口</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/inherited-interface\">インターフェイスを継承して新しいインターフェイスを作る</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/call-base-class-function\">基底クラスのメンバ関数を呼び出したいんだけど・・・</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/not-definit-const-static-in-header\">const static なメンバ変数の実装はヘッダファイルで行わない</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/pure-virtual-definition\">純粋仮想関数は定義を持てる</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/interface-test\">インターフェイスの実験</a>\n </li>\n\n \n </ul>\n \n </div>\n \n\n</div>\n\n </div>\n <footer class=\"container\">\n <hr>\n <div class=\"row\">\n <div class=\"col\">\n <p class=\"text-right\">\n <a href=\"https://leico.github.io/TechnicalNote/atom.xml\">Atom</a>\n </p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-8\">\n <div class=\"row\">\n <div class=\"col-md-4\">\n <figure class=\"figure\">\n <img src=\"https://leico.github.io/TechnicalNote/image/logo.png\" class=\"figure-img rounded\" width=\"200px\" height=\"auto\" alt=\"\">\n </figure>\n </div>\n <div class=\"col-md-4\">\n <h5>contact</h5>\n <ul class=\"list-unstyled\">\n <li> <a href=\"https://github.com/leico\" class=\"user-mention\">@leico</a> </li>\n <li> <a href=\"https://www.twitter.com/1_0101\">twitter</a>\n</li>\n <li> <a href=\"https://leico.github.io\">web</a>\n </li>\n</ul>\n </div>\n </div>\n </div>\n <div class=\"col-md-4\">\n <h5>Merchandise/Schwags</h5>\n <p><small class=\"text-muted\">支援してくれるとうれしい</small></p>\n <iframe frameborder=\"0\" height=\"220\" width=\"160\" src=\"https://leico.official.ec/items/6694858/widget/small\"></iframe>\n </div>\n </div>\n <p class=\"text-right\">\n <small class=\"text-muted\">© 2017 leico.</small>\n </p>\n\n</footer>\n\n </body>\n</html>\n", "id": "/Cpp/Explicit-specialization-of-after-instantiation", "previous": null, "url": "/Cpp/Explicit-specialization-of-after-instantiation", "relative_path": "_docs/Cpp/Explicit-specialization-of-after-instantiation.md", "collection": "docs", "next": { "content": "<p>C++でメンバ変数へのアクセサを作る場合、最近こうやっている。</p>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"k\">class</span> <span class=\"nc\">C</span><span class=\"p\">{</span>\n\n<span class=\"k\">private</span><span class=\"o\">:</span>\n <span class=\"kt\">int</span> <span class=\"n\">_value</span><span class=\"p\">;</span>\n<span class=\"k\">public</span><span class=\"o\">:</span>\n <span class=\"n\">C</span><span class=\"p\">(){};</span>\n <span class=\"o\">~</span><span class=\"n\">C</span><span class=\"p\">(){};</span>\n <span class=\"kt\">int</span> <span class=\"n\">Value</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span><span class=\"k\">return</span> <span class=\"n\">_value</span><span class=\"p\">;}</span>\n <span class=\"kt\">int</span> <span class=\"n\">Value</span><span class=\"p\">(</span><span class=\"k\">const</span> <span class=\"kt\">int</span> <span class=\"n\">value</span><span class=\"p\">){</span> <span class=\"n\">_value</span> <span class=\"o\">=</span> <span class=\"n\">value</span><span class=\"p\">;</span> <span class=\"k\">return</span> <span class=\"n\">_value</span><span class=\"p\">;</span> <span class=\"p\">}</span>\n\n<span class=\"p\">};</span>\n</code></pre></div></div>\n\n<p>オーバーロードを用いてこんな感じにしている。</p>\n\n<p>メンバ変数と同じような名前にすることで</p>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"kt\">int</span> <span class=\"n\">main</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">C</span> <span class=\"n\">c</span><span class=\"p\">;</span>\n <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Value</span><span class=\"p\">(</span> <span class=\"mi\">1970</span> <span class=\"o\">+</span> <span class=\"mi\">45</span> <span class=\"p\">);</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"mi\">100</span> <span class=\"o\">+</span> <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Value</span><span class=\"p\">()</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n\n <span class=\"k\">return</span> <span class=\"mi\">0</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n</code></pre></div></div>\n\n<p><code class=\"highlighter-rouge\">get</code>、<code class=\"highlighter-rouge\">set</code>とするよりかなりスマートでは?</p>\n\n<p>テンプレートクラスの場合はこんな感じ。</p>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"k\">template</span><span class=\"o\">&lt;</span><span class=\"k\">typename</span> <span class=\"n\">T</span><span class=\"o\">&gt;</span>\n<span class=\"k\">class</span> <span class=\"nc\">C</span><span class=\"p\">{</span>\n <span class=\"k\">private</span><span class=\"o\">:</span>\n <span class=\"n\">T</span> <span class=\"n\">_value</span><span class=\"p\">;</span>\n <span class=\"k\">public</span><span class=\"o\">:</span>\n <span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){};</span>\n <span class=\"o\">~</span><span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){};</span>\n\n <span class=\"k\">const</span> <span class=\"n\">T</span><span class=\"o\">&amp;</span> <span class=\"n\">Value</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span> <span class=\"k\">return</span> <span class=\"n\">_value</span><span class=\"p\">;</span> <span class=\"p\">}</span>\n <span class=\"k\">const</span> <span class=\"n\">T</span><span class=\"o\">&amp;</span> <span class=\"n\">Value</span><span class=\"p\">(</span><span class=\"k\">const</span> <span class=\"n\">T</span><span class=\"o\">&amp;</span> <span class=\"n\">value</span><span class=\"p\">){</span> <span class=\"n\">_value</span> <span class=\"o\">=</span> <span class=\"n\">value</span><span class=\"p\">;</span> <span class=\"k\">return</span> <span class=\"n\">_value</span><span class=\"p\">;</span> <span class=\"p\">}</span> \n<span class=\"p\">};</span>\n\n<span class=\"kt\">int</span> <span class=\"n\">main</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n\n <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">string</span><span class=\"o\">&gt;</span> <span class=\"n\">c</span><span class=\"p\">;</span> <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Value</span><span class=\"p\">(</span><span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">string</span><span class=\"p\">(</span><span class=\"err\">“</span><span class=\"n\">Str</span> <span class=\"o\">:</span><span class=\"err\">”</span><span class=\"p\">)</span> <span class=\"p\">);</span>\n\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Value</span><span class=\"p\">()</span> <span class=\"o\">+</span> <span class=\"err\">“</span><span class=\"n\">Test</span> <span class=\"n\">String</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n\n <span class=\"k\">return</span> <span class=\"mi\">0</span><span class=\"p\">;</span> \n<span class=\"p\">}</span>\n</code></pre></div></div>\n", "output": "<!DOCTYPE html>\n<html lang=\"ja\">\n <head>\n <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n \n <meta name=\"keywords\" content=\"C++,class,member,overload,accessor\">\n\n\n <title>アクセサ</title>\n\n <!– bootstrap and jQuery include –>\n <link rel=\"stylesheet\" href=\"https://leico.github.io/TechnicalNote/css/style.css\">\n <script type=\"text/javascript\" src=\"https://leico.github.io/TechnicalNote/js/jquery-3.1.1.min.js\"></script>\n <script type=\"text/javascript\" src=\"https://leico.github.io/TechnicalNote/js/bootstrap/bootstrap.min.js\"></script>\n <!– bootstrap and jQuery include –>\n\n <!– MathJax include –>\n <script type=\"text/javascript\" src=\"https://leico.github.io/TechnicalNote/js/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML\"></script>\n\n <!– Google Analytics –>\n <script>\n (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,’script’,’https://www.google-analytics.com/analytics.js’,’ga’);\n \n ga(‘create’, ‘UA-100782315-1’, ‘auto’);\n ga(‘send’, ‘pageview’);\n </script>\n\n <!– Atom feed –>\n <link type=\"application/atom+xml\" rel=\"alternate\" href=\"https://leico.github.io/TechnicalNote/atom.xml\" title=\"TechnicalNote\" />\n</head>\n\n\n <body>\n <div class=\"container\">\n <div class=\"row\">\n\n\n <div class=\"col-md-8\">\n\n <header class=\"page-header\">\n <h1>アクセサ</h1>\n <div class=\"row\">\n\n <div class=\"col-6\">\n <dl class=\"dl-horizontal\">\n <dt>created</dt>\n <dd>2016-09-13</dd>\n <dt>last change</dt>\n <dd>2017-03-06 01:21:10 +0000</dd>\n </dl>\n </div>\n\n <div class=\"col-6 text-right\">\n <a href=\"https://twitter.com/share\" class=\"twitter-share-button\">Tweet</a>\n <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?’http’:’https’;if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+’://platform.twitter.com/widgets.js’;fjs.parentNode.insertBefore(js,fjs);}}(document, ‘script’, ‘twitter-wjs’);</script>\n </div>\n\n </div>\n </header>\n\n <div class=\"row\">\n\n <div class=\"col-12\">\n <p>C++でメンバ変数へのアクセサを作る場合、最近こうやっている。</p>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"k\">class</span> <span class=\"nc\">C</span><span class=\"p\">{</span>\n\n<span class=\"k\">private</span><span class=\"o\">:</span>\n <span class=\"kt\">int</span> <span class=\"n\">_value</span><span class=\"p\">;</span>\n<span class=\"k\">public</span><span class=\"o\">:</span>\n <span class=\"n\">C</span><span class=\"p\">(){};</span>\n <span class=\"o\">~</span><span class=\"n\">C</span><span class=\"p\">(){};</span>\n <span class=\"kt\">int</span> <span class=\"n\">Value</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span><span class=\"k\">return</span> <span class=\"n\">_value</span><span class=\"p\">;}</span>\n <span class=\"kt\">int</span> <span class=\"n\">Value</span><span class=\"p\">(</span><span class=\"k\">const</span> <span class=\"kt\">int</span> <span class=\"n\">value</span><span class=\"p\">){</span> <span class=\"n\">_value</span> <span class=\"o\">=</span> <span class=\"n\">value</span><span class=\"p\">;</span> <span class=\"k\">return</span> <span class=\"n\">_value</span><span class=\"p\">;</span> <span class=\"p\">}</span>\n\n<span class=\"p\">};</span>\n</code></pre></div></div>\n\n<p>オーバーロードを用いてこんな感じにしている。</p>\n\n<p>メンバ変数と同じような名前にすることで</p>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"kt\">int</span> <span class=\"n\">main</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">C</span> <span class=\"n\">c</span><span class=\"p\">;</span>\n <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Value</span><span class=\"p\">(</span> <span class=\"mi\">1970</span> <span class=\"o\">+</span> <span class=\"mi\">45</span> <span class=\"p\">);</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"mi\">100</span> <span class=\"o\">+</span> <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Value</span><span class=\"p\">()</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n\n <span class=\"k\">return</span> <span class=\"mi\">0</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n</code></pre></div></div>\n\n<p><code class=\"highlighter-rouge\">get</code>、<code class=\"highlighter-rouge\">set</code>とするよりかなりスマートでは?</p>\n\n<p>テンプレートクラスの場合はこんな感じ。</p>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"k\">template</span><span class=\"o\">&lt;</span><span class=\"k\">typename</span> <span class=\"n\">T</span><span class=\"o\">&gt;</span>\n<span class=\"k\">class</span> <span class=\"nc\">C</span><span class=\"p\">{</span>\n <span class=\"k\">private</span><span class=\"o\">:</span>\n <span class=\"n\">T</span> <span class=\"n\">_value</span><span class=\"p\">;</span>\n <span class=\"k\">public</span><span class=\"o\">:</span>\n <span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){};</span>\n <span class=\"o\">~</span><span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){};</span>\n\n <span class=\"k\">const</span> <span class=\"n\">T</span><span class=\"o\">&amp;</span> <span class=\"n\">Value</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span> <span class=\"k\">return</span> <span class=\"n\">_value</span><span class=\"p\">;</span> <span class=\"p\">}</span>\n <span class=\"k\">const</span> <span class=\"n\">T</span><span class=\"o\">&amp;</span> <span class=\"n\">Value</span><span class=\"p\">(</span><span class=\"k\">const</span> <span class=\"n\">T</span><span class=\"o\">&amp;</span> <span class=\"n\">value</span><span class=\"p\">){</span> <span class=\"n\">_value</span> <span class=\"o\">=</span> <span class=\"n\">value</span><span class=\"p\">;</span> <span class=\"k\">return</span> <span class=\"n\">_value</span><span class=\"p\">;</span> <span class=\"p\">}</span> \n<span class=\"p\">};</span>\n\n<span class=\"kt\">int</span> <span class=\"n\">main</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n\n <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">string</span><span class=\"o\">&gt;</span> <span class=\"n\">c</span><span class=\"p\">;</span> <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Value</span><span class=\"p\">(</span><span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">string</span><span class=\"p\">(</span><span class=\"err\">“</span><span class=\"n\">Str</span> <span class=\"o\">:</span><span class=\"err\">”</span><span class=\"p\">)</span> <span class=\"p\">);</span>\n\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Value</span><span class=\"p\">()</span> <span class=\"o\">+</span> <span class=\"err\">“</span><span class=\"n\">Test</span> <span class=\"n\">String</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n\n <span class=\"k\">return</span> <span class=\"mi\">0</span><span class=\"p\">;</span> \n<span class=\"p\">}</span>\n</code></pre></div></div>\n\n </div>\n\n <div class=\"col-12\">\n <hr>\n <a href=\"https://twitter.com/share\" class=\"twitter-share-button\">Tweet</a>\n <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?’http’:’https’;if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+’://platform.twitter.com/widgets.js’;fjs.parentNode.insertBefore(js,fjs);}}(document, ‘script’, ‘twitter-wjs’);</script>\n </div>\n\n </div>\n\n </div>\n \n <div class=\"col-md-4\">\n <h2>\n <a href=\"https://leico.github.io/TechnicalNote/\">\n Technical Note\n </a>\n </h2>\n\n \n\n \n\n <h3>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp\">C++ Top</a>\n </h3>\n\n \n <h3>C++11 Tips</h3>\n <ul>\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/template-template-parameter\">テンプレートテンプレートパラメータまとめ</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/is-same-base-of\">std :: is_same と std :: is_base_of の挙動を調べる</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/private-using\">using や typedef にもアクセス指定子が乗る</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/enum-class-operator\">enum class 同士の計算を僕も実装してみた</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/template-specialize-inherit\">クラステンプレートの特殊化ごとに継承元を変更する</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/variadic-template\">可変引数テンプレートパラメータいろいろ</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/using_error\">std :: conditional の判定式でエラー</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/cast_specialization\">テンプレート型変換演算子を特殊化する</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/has_trivial_assign\">has_trivial_assign は is_trivially_copy_assignable になった</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/lambda\">ラムダ式を利用する</a>\n </li>\n\n \n </ul>\n \n <h3>Tips</h3>\n <ul>\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/overload-cast\">キャスト演算子のオーバーロード</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/accessor\">アクセサ</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/Explicit-specialization-of-after-instantiation\">Explicit specialization of “ after instantiation</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/part-of-specialize\">特定のメンバ関数だけ特殊化</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/template-specialization\">テンプレート特殊化の入り口</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/inherited-interface\">インターフェイスを継承して新しいインターフェイスを作る</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/call-base-class-function\">基底クラスのメンバ関数を呼び出したいんだけど・・・</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/not-definit-const-static-in-header\">const static なメンバ変数の実装はヘッダファイルで行わない</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/pure-virtual-definition\">純粋仮想関数は定義を持てる</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/interface-test\">インターフェイスの実験</a>\n </li>\n\n \n </ul>\n \n </div>\n \n\n</div>\n\n </div>\n <footer class=\"container\">\n <hr>\n <div class=\"row\">\n <div class=\"col\">\n <p class=\"text-right\">\n <a href=\"https://leico.github.io/TechnicalNote/atom.xml\">Atom</a>\n </p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-8\">\n <div class=\"row\">\n <div class=\"col-md-4\">\n <figure class=\"figure\">\n <img src=\"https://leico.github.io/TechnicalNote/image/logo.png\" class=\"figure-img rounded\" width=\"200px\" height=\"auto\" alt=\"\">\n </figure>\n </div>\n <div class=\"col-md-4\">\n <h5>contact</h5>\n <ul class=\"list-unstyled\">\n <li> <a href=\"https://github.com/leico\" class=\"user-mention\">@leico</a> </li>\n <li> <a href=\"https://www.twitter.com/1_0101\">twitter</a>\n</li>\n <li> <a href=\"https://leico.github.io\">web</a>\n </li>\n</ul>\n </div>\n </div>\n </div>\n <div class=\"col-md-4\">\n <h5>Merchandise/Schwags</h5>\n <p><small class=\"text-muted\">支援してくれるとうれしい</small></p>\n <iframe frameborder=\"0\" height=\"220\" width=\"160\" src=\"https://leico.official.ec/items/6694858/widget/small\"></iframe>\n </div>\n </div>\n <p class=\"text-right\">\n <small class=\"text-muted\">© 2017 leico.</small>\n </p>\n\n</footer>\n\n </body>\n</html>\n", "id": "/Cpp/accessor", "previous": { "content": "<h2 id=\"maincpp\">main.cpp</h2>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"cp\">#include &lt;iostream&gt;\n</span>\n<span class=\"k\">template</span><span class=\"o\">&lt;</span><span class=\"k\">typename</span> <span class=\"n\">T</span><span class=\"o\">&gt;</span>\n<span class=\"k\">class</span> <span class=\"nc\">C</span><span class=\"p\">{</span>\n\n <span class=\"k\">public</span><span class=\"o\">:</span>\n <span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n <span class=\"o\">~</span><span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n\n <span class=\"kt\">void</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n <span class=\"kt\">void</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n<span class=\"p\">};</span>\n\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Fx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n <span class=\"n\">Gx</span><span class=\"p\">();</span>\n<span class=\"p\">}</span>\n\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Gx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n\n<span class=\"kt\">int</span> <span class=\"n\">main</span><span class=\"p\">(</span><span class=\"kt\">int</span> <span class=\"n\">argc</span><span class=\"p\">,</span> <span class=\"k\">const</span> <span class=\"kt\">char</span> <span class=\"o\"></span> <span class=\"n\">argv</span><span class=\"p\">[])</span>\n<span class=\"p\">{</span>\n\n <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"n\">c</span><span class=\"p\">;</span>\n\n <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Fx</span><span class=\"p\">();</span>\n\n <span class=\"k\">return</span> <span class=\"mi\">0</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n</code></pre></div></div>\n\n<p>こんなソースコードで<code class=\"highlighter-rouge\">Explicit specialization of ‘Gx’ after instantiation</code>って怒られた。</p>\n\n<p>テンプレート特殊化の際には、関数の中で特殊化した関数を呼び出す時は、\n先に呼び出す関数を記述してあげないといけない。</p>\n\n<h2 id=\"maincpp-1\">main.cpp</h2>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"cp\">#include &lt;iostream&gt;\n</span>\n<span class=\"k\">template</span><span class=\"o\">&lt;</span><span class=\"k\">typename</span> <span class=\"n\">T</span><span class=\"o\">&gt;</span>\n<span class=\"k\">class</span> <span class=\"nc\">C</span><span class=\"p\">{</span>\n\n <span class=\"k\">public</span><span class=\"o\">:</span>\n <span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n <span class=\"o\">~</span><span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n\n <span class=\"kt\">void</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n <span class=\"kt\">void</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n<span class=\"p\">};</span>\n\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Gx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Fx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n <span class=\"n\">Gx</span><span class=\"p\">();</span>\n<span class=\"p\">}</span>\n\n\n\n<span class=\"kt\">int</span> <span class=\"n\">main</span><span class=\"p\">(</span><span class=\"kt\">int</span> <span class=\"n\">argc</span><span class=\"p\">,</span> <span class=\"k\">const</span> <span class=\"kt\">char</span> <span class=\"o\"></span> <span class=\"n\">argv</span><span class=\"p\">[])</span>\n<span class=\"p\">{</span>\n\n <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"n\">c</span><span class=\"p\">;</span>\n\n <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Fx</span><span class=\"p\">();</span>\n\n <span class=\"k\">return</span> <span class=\"mi\">0</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n</code></pre></div></div>\n\n<p>これならコンパイルが通る。FxとGxの実装順番を変えただけ。</p>\n\n<h2 id=\"output\">output</h2>\n\n<div class=\"highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>Fx\nGx\n</code></pre></div></div>\n", "output": "<!DOCTYPE html>\n<html lang=\"ja\">\n <head>\n <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n \n <meta name=\"keywords\" content=\"C++,genelic,programming,template,meta\">\n\n\n <title>Explicit specialization of “ after instantiation</title>\n\n <!– bootstrap and jQuery include –>\n <link rel=\"stylesheet\" href=\"https://leico.github.io/TechnicalNote/css/style.css\">\n <script type=\"text/javascript\" src=\"https://leico.github.io/TechnicalNote/js/jquery-3.1.1.min.js\"></script>\n <script type=\"text/javascript\" src=\"https://leico.github.io/TechnicalNote/js/bootstrap/bootstrap.min.js\"></script>\n <!– bootstrap and jQuery include –>\n\n <!– MathJax include –>\n <script type=\"text/javascript\" src=\"https://leico.github.io/TechnicalNote/js/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML\"></script>\n\n <!– Google Analytics –>\n <script>\n (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,’script’,’https://www.google-analytics.com/analytics.js’,’ga’);\n \n ga(‘create’, ‘UA-100782315-1’, ‘auto’);\n ga(‘send’, ‘pageview’);\n </script>\n\n <!– Atom feed –>\n <link type=\"application/atom+xml\" rel=\"alternate\" href=\"https://leico.github.io/TechnicalNote/atom.xml\" title=\"TechnicalNote\" />\n</head>\n\n\n <body>\n <div class=\"container\">\n <div class=\"row\">\n\n\n <div class=\"col-md-8\">\n\n <header class=\"page-header\">\n <h1>Explicit specialization of “ after instantiation</h1>\n <div class=\"row\">\n\n <div class=\"col-6\">\n <dl class=\"dl-horizontal\">\n <dt>created</dt>\n <dd>2016-09-13</dd>\n <dt>last change</dt>\n <dd>2017-03-06 00:13:17 +0000</dd>\n </dl>\n </div>\n\n <div class=\"col-6 text-right\">\n <a href=\"https://twitter.com/share\" class=\"twitter-share-button\">Tweet</a>\n <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?’http’:’https’;if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+’://platform.twitter.com/widgets.js’;fjs.parentNode.insertBefore(js,fjs);}}(document, ‘script’, ‘twitter-wjs’);</script>\n </div>\n\n </div>\n </header>\n\n <div class=\"row\">\n\n <div class=\"col-12\">\n <h2 id=\"maincpp\">main.cpp</h2>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"cp\">#include &lt;iostream&gt;\n</span>\n<span class=\"k\">template</span><span class=\"o\">&lt;</span><span class=\"k\">typename</span> <span class=\"n\">T</span><span class=\"o\">&gt;</span>\n<span class=\"k\">class</span> <span class=\"nc\">C</span><span class=\"p\">{</span>\n\n <span class=\"k\">public</span><span class=\"o\">:</span>\n <span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n <span class=\"o\">~</span><span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n\n <span class=\"kt\">void</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n <span class=\"kt\">void</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n<span class=\"p\">};</span>\n\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Fx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n <span class=\"n\">Gx</span><span class=\"p\">();</span>\n<span class=\"p\">}</span>\n\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Gx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n\n<span class=\"kt\">int</span> <span class=\"n\">main</span><span class=\"p\">(</span><span class=\"kt\">int</span> <span class=\"n\">argc</span><span class=\"p\">,</span> <span class=\"k\">const</span> <span class=\"kt\">char</span> <span class=\"o\"></span> <span class=\"n\">argv</span><span class=\"p\">[])</span>\n<span class=\"p\">{</span>\n\n <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"n\">c</span><span class=\"p\">;</span>\n\n <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Fx</span><span class=\"p\">();</span>\n\n <span class=\"k\">return</span> <span class=\"mi\">0</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n</code></pre></div></div>\n\n<p>こんなソースコードで<code class=\"highlighter-rouge\">Explicit specialization of ‘Gx’ after instantiation</code>って怒られた。</p>\n\n<p>テンプレート特殊化の際には、関数の中で特殊化した関数を呼び出す時は、\n先に呼び出す関数を記述してあげないといけない。</p>\n\n<h2 id=\"maincpp-1\">main.cpp</h2>\n\n<div class=\"language-cpp highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"cp\">#include &lt;iostream&gt;\n</span>\n<span class=\"k\">template</span><span class=\"o\">&lt;</span><span class=\"k\">typename</span> <span class=\"n\">T</span><span class=\"o\">&gt;</span>\n<span class=\"k\">class</span> <span class=\"nc\">C</span><span class=\"p\">{</span>\n\n <span class=\"k\">public</span><span class=\"o\">:</span>\n <span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n <span class=\"o\">~</span><span class=\"n\">C</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){}</span>\n\n <span class=\"kt\">void</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n <span class=\"kt\">void</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">);</span>\n<span class=\"p\">};</span>\n\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Gx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Gx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n<span class=\"k\">template</span><span class=\"o\">&lt;&gt;</span>\n<span class=\"kr\">inline</span> <span class=\"kt\">void</span> <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"o\">::</span> <span class=\"n\">Fx</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">){</span>\n <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">cout</span> <span class=\"o\">&lt;&lt;</span> <span class=\"err\">“</span><span class=\"n\">Fx</span><span class=\"err\">”</span> <span class=\"o\">&lt;&lt;</span> <span class=\"n\">std</span> <span class=\"o\">::</span> <span class=\"n\">endl</span><span class=\"p\">;</span>\n <span class=\"n\">Gx</span><span class=\"p\">();</span>\n<span class=\"p\">}</span>\n\n\n\n<span class=\"kt\">int</span> <span class=\"n\">main</span><span class=\"p\">(</span><span class=\"kt\">int</span> <span class=\"n\">argc</span><span class=\"p\">,</span> <span class=\"k\">const</span> <span class=\"kt\">char</span> <span class=\"o\">*</span> <span class=\"n\">argv</span><span class=\"p\">[])</span>\n<span class=\"p\">{</span>\n\n <span class=\"n\">C</span><span class=\"o\">&lt;</span><span class=\"kt\">int</span><span class=\"o\">&gt;</span> <span class=\"n\">c</span><span class=\"p\">;</span>\n\n <span class=\"n\">c</span><span class=\"p\">.</span><span class=\"n\">Fx</span><span class=\"p\">();</span>\n\n <span class=\"k\">return</span> <span class=\"mi\">0</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n</code></pre></div></div>\n\n<p>これならコンパイルが通る。FxとGxの実装順番を変えただけ。</p>\n\n<h2 id=\"output\">output</h2>\n\n<div class=\"highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>Fx\nGx\n</code></pre></div></div>\n\n </div>\n\n <div class=\"col-12\">\n <hr>\n <a href=\"https://twitter.com/share\" class=\"twitter-share-button\">Tweet</a>\n <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?’http’:’https’;if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+’://platform.twitter.com/widgets.js’;fjs.parentNode.insertBefore(js,fjs);}}(document, ‘script’, ‘twitter-wjs’);</script>\n </div>\n\n </div>\n\n </div>\n \n <div class=\"col-md-4\">\n <h2>\n <a href=\"https://leico.github.io/TechnicalNote/\">\n Technical Note\n </a>\n </h2>\n\n \n\n \n\n <h3>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp\">C++ Top</a>\n </h3>\n\n \n <h3>C++11 Tips</h3>\n <ul>\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/template-template-parameter\">テンプレートテンプレートパラメータまとめ</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/is-same-base-of\">std :: is_same と std :: is_base_of の挙動を調べる</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/private-using\">using や typedef にもアクセス指定子が乗る</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/enum-class-operator\">enum class 同士の計算を僕も実装してみた</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/template-specialize-inherit\">クラステンプレートの特殊化ごとに継承元を変更する</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/variadic-template\">可変引数テンプレートパラメータいろいろ</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/using_error\">std :: conditional の判定式でエラー</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/cast_specialization\">テンプレート型変換演算子を特殊化する</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/has_trivial_assign\">has_trivial_assign は is_trivially_copy_assignable になった</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/lambda\">ラムダ式を利用する</a>\n </li>\n\n \n </ul>\n \n <h3>Tips</h3>\n <ul>\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/overload-cast\">キャスト演算子のオーバーロード</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/accessor\">アクセサ</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/Explicit-specialization-of-after-instantiation\">Explicit specialization of “ after instantiation</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/part-of-specialize\">特定のメンバ関数だけ特殊化</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/template-specialization\">テンプレート特殊化の入り口</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/inherited-interface\">インターフェイスを継承して新しいインターフェイスを作る</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/call-base-class-function\">基底クラスのメンバ関数を呼び出したいんだけど・・・</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/not-definit-const-static-in-header\">const static なメンバ変数の実装はヘッダファイルで行わない</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/pure-virtual-definition\">純粋仮想関数は定義を持てる</a>\n </li>\n\n \n\n \n\n \n \n\n <li>\n <a href=\"https://leico.github.io/TechnicalNote/Cpp/interface-test\">インターフェイスの実験</a>\n </li>\n\n \n </ul>\n \n </div>\n \n\n</div>\n\n </div>\n <footer class=\"container\">\n <hr>\n <div class=\"row\">\n <div class=\"col\">\n <p class=\"text-right\">\n <a href=\"https://leico.github.io/TechnicalNote/atom.xml\">Atom</a>\n </p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-8\">\n <div class=\"row\">\n <div class=\"col-md-4\">\n <figure class=\"figure\">\n <img src=\"https://leico.github.io/TechnicalNote/image/logo.png\" class=\"figure-img rounded\" width=\"200px\" height=\"auto\" alt=\"\">\n </figure>\n </div>\n <div class=\"col-md-4\">\n <h5>contact</h5>\n <ul class=\"list-unstyled\">\n <li> <a href=\"https://github.com/leico\" class=\"user-mention\">@leico</a> </li>\n <li> <a href=\"https://www.twitter.com/1_0101\">twitter</a>\n</li>\n <li> <a href=\"https://leico.github.io\">web</a>\n </li>\n</ul>\n </div>\n </div>\n </div>\n <div class=\"col-md-4\">\n <h5>Merchandise/Schwags</h5>\n <p><small class=\"text-muted\">支援してくれるとうれしい</small></p>\n <iframe frameborder=\"0\" height=\"220\" width=\"160\" src=\"https://leico.official.ec/items/6694858/widget/small\"></iframe>\n </div>\n </div>\n <p class=\"text-right\">\n <small class=\"text-muted\">© 2017 leico.</small>\n </p>\n\n</footer>\n\n </body>\n</html>\n", "id": "/Cpp/Explicit-specialization-of-after-instantiation", "previous": null, "url": "/Cpp/Explicit-specialization-of-after-instantiation", "relative_path": "_docs/Cpp/Explicit-specialization-of-after-instantiation.md", "collection": "docs", "next": { "id": "/Cpp/accessor", "url": "/Cpp/accessor", "relative_path": "_docs/Cpp/accessor.md", "collection": "docs", "path": "_docs/Cpp/accessor.md", "draft": false, "categories": [

    ],
    &quot;layout&quot;: &quot;post&quot;,
    &quot;title&quot;: &quot;アクセサ&quot;,
    &quot;date&quot;: &quot;2016-09-13 00:00:00 +0900&quot;,
    &quot;lastchange&quot;: &quot;2017-03-06 01:21:10 +0000&quot;,
    &quot;tags&quot;: [
      &quot;C++&quot;,
      &quot;class&quot;,
      &quot;member&quot;,
      &quot;overload&quot;,
      &quot;accessor&quot;
    ],
    &quot;slug&quot;: &quot;accessor&quot;,
    &quot;ext&quot;: &quot;.md&quot;
  },
  &quot;path&quot;: &quot;_docs/Cpp/Explicit-specialization-of-after-instantiation.md&quot;,
  &quot;excerpt&quot;: &quot;&lt;h2 id=\&quot;maincpp\&quot;&gt;main.cpp&lt;/h2&gt;\n\n&quot;,
  &quot;draft&quot;: false,
  &quot;categories&quot;: [

  ],
  &quot;layout&quot;: &quot;post&quot;,
  &quot;title&quot;: &quot;Explicit specialization of “ after instantiation&quot;,
  &quot;date&quot;: &quot;2016-09-13 00:00:00 +0900&quot;,
  &quot;lastchange&quot;: &quot;2017-03-06 00:13:17 +0000&quot;,
  &quot;tags&quot;: [
    &quot;C++&quot;,
    &quot;genelic&quot;,
    &quot;programming&quot;,
    &quot;template&quot;,
    &quot;meta&quot;
  ],
  &quot;slug&quot;: &quot;Explicit-specialization-of-after-instantiation&quot;,
  &quot;ext&quot;: &quot;.md&quot;
},
&quot;url&quot;: &quot;/Cpp/accessor&quot;,
&quot;relative_path&quot;: &quot;_docs/Cpp/accessor.md&quot;,
&quot;collection&quot;: &quot;docs&quot;,
&quot;next&quot;: {
  &quot;content&quot;: &quot;&lt;h2 id=\&quot;classh\&quot;&gt;class.h&lt;/h2&gt;\n\n&lt;div class=\&quot;language-cpp highlighter-rouge\&quot;&gt;&lt;div class=\&quot;highlight\&quot;&gt;&lt;pre class=\&quot;highlight\&quot;&gt;&lt;code&gt;&lt;span class=\&quot;k\&quot;&gt;class&lt;/span&gt; &lt;span class=\&quot;nc\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;{&lt;/span&gt;\n  &lt;span class=\&quot;k\&quot;&gt;public&lt;/span&gt;&lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt;\n             &lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;~&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;=&lt;/span&gt; &lt;span class=\&quot;mi\&quot;&gt;0&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;=&lt;/span&gt; &lt;span class=\&quot;mi\&quot;&gt;0&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;=&lt;/span&gt; &lt;span class=\&quot;mi\&quot;&gt;0&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n&lt;span class=\&quot;p\&quot;&gt;};&lt;/span&gt;\n\n&lt;span class=\&quot;k\&quot;&gt;class&lt;/span&gt; &lt;span class=\&quot;nc\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt; &lt;span class=\&quot;k\&quot;&gt;public&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;{&lt;/span&gt;\n\n  &lt;span class=\&quot;k\&quot;&gt;public&lt;/span&gt;&lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt;\n             &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;~&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n&lt;span class=\&quot;p\&quot;&gt;};&lt;/span&gt;\n\n&lt;span class=\&quot;k\&quot;&gt;class&lt;/span&gt; &lt;span class=\&quot;nc\&quot;&gt;E&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt; &lt;span class=\&quot;k\&quot;&gt;public&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;{&lt;/span&gt;\n\n  &lt;span class=\&quot;k\&quot;&gt;public&lt;/span&gt;&lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt;\n             &lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;~&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n\n&lt;span class=\&quot;p\&quot;&gt;};&lt;/span&gt;\n&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;\n\n&lt;h2 id=\&quot;classcpp\&quot;&gt;class.cpp&lt;/h2&gt;\n\n&lt;div class=\&quot;language-cpp highlighter-rouge\&quot;&gt;&lt;div class=\&quot;highlight\&quot;&gt;&lt;pre class=\&quot;highlight\&quot;&gt;&lt;code&gt;&lt;span class=\&quot;cp\&quot;&gt;#include &amp;lt;iostream&amp;gt;\n&lt;/span&gt;&lt;span class=\&quot;k\&quot;&gt;using&lt;/span&gt; &lt;span class=\&quot;k\&quot;&gt;namespace&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;std&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n\n&lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt;  &lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;~&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){}&lt;/span&gt;\n\n&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt;  &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(){}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;~&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt;      &lt;span class=\&quot;p\&quot;&gt;{}&lt;/span&gt;\n\n&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;cout&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=\&quot;s\&quot;&gt;\&quot;D :: F\&quot;&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;endl&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt; &lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt; &lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt; &lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n\n&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt;  &lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(){}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;~&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt;      &lt;span class=\&quot;p\&quot;&gt;{}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;cout&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=\&quot;s\&quot;&gt;\&quot;E :: F\&quot;&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;endl&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt; &lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt; &lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt; &lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;\n\n&lt;h2 id=\&quot;maincpp\&quot;&gt;main.cpp&lt;/h2&gt;\n\n&lt;div class=\&quot;language-cpp highlighter-rouge\&quot;&gt;&lt;div class=\&quot;highlight\&quot;&gt;&lt;pre class=\&quot;highlight\&quot;&gt;&lt;code&gt;&lt;span class=\&quot;cp\&quot;&gt;#include &amp;lt;iostream&amp;gt;\n&lt;/span&gt;&lt;span class=\&quot;k\&quot;&gt;using&lt;/span&gt; &lt;span class=\&quot;k\&quot;&gt;namespace&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;std&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n\n&lt;span class=\&quot;kt\&quot;&gt;int&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;main&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt;\n  &lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;*&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;c&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;=&lt;/span&gt; &lt;span class=\&quot;k\&quot;&gt;new&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt;\n\n  &lt;span class=\&quot;n\&quot;&gt;c&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt;\n  &lt;span class=\&quot;n\&quot;&gt;c&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt;\n  &lt;span class=\&quot;n\&quot;&gt;c&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt;\n\n  &lt;span class=\&quot;k\&quot;&gt;delete&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;c&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n  &lt;span class=\&quot;k\&quot;&gt;return&lt;/span&gt; &lt;span class=\&quot;mi\&quot;&gt;0&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n&lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;\n\n&lt;p&gt;これが、&lt;/p&gt;\n\n&lt;h2 id=\&quot;output\&quot;&gt;output&lt;/h2&gt;\n\n&lt;div class=\&quot;highlighter-rouge\&quot;&gt;&lt;div class=\&quot;highlight\&quot;&gt;&lt;pre class=\&quot;highlight\&quot;&gt;&lt;code&gt;D :: F\nE :: F\nD :: F\nE :: F\nD :: F\nE :: F\n&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;\n\n&lt;p&gt;こうなる。&lt;/p&gt;\n\n&lt;div class=\&quot;highlighter-rouge\&quot;&gt;&lt;div class=\&quot;highlight\&quot;&gt;&lt;pre class=\&quot;highlight\&quot;&gt;&lt;code&gt;E :: F -&amp;gt; D :: F\nE :: G -&amp;gt; D :: G -&amp;gt; E :: F -&amp;gt; D :: F\nE :: H -&amp;gt; D :: H -&amp;gt; E :: G -&amp;gt; D :: G -&amp;gt; E :: F -&amp;gt; D :: F\n&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;\n\n&lt;p&gt;と呼び出されているようだ。つまり、\n&lt;code class=\&quot;highlighter-rouge\&quot;&gt;D :: G()&lt;/code&gt;で呼び出している&lt;code class=\&quot;highlighter-rouge\&quot;&gt;F()&lt;/code&gt;は&lt;code class=\&quot;highlighter-rouge\&quot;&gt;E :: F()&lt;/code&gt;になっていて、 &lt;code class=\&quot;highlighter-rouge\&quot;&gt;D :: H()&lt;/code&gt;で呼び出している&lt;code class=\&quot;highlighter-rouge\&quot;&gt;G()&lt;/code&gt;は&lt;code class=\&quot;highlighter-rouge\&quot;&gt;E :: G()&lt;/code&gt;になっている。&lt;/p&gt;\n\n&lt;p&gt;仮想関数テーブルってむずかし。&lt;/p&gt;\n\n&lt;div class=\&quot;highlighter-rouge\&quot;&gt;&lt;div class=\&quot;highlight\&quot;&gt;&lt;pre class=\&quot;highlight\&quot;&gt;&lt;code&gt;D :: F(void){ cout &amp;lt;&amp;lt; \&quot;D :: F\&quot; &amp;lt;&amp;lt; endl; }\nD :: G(void){ D :: F(); }\nD :: H(void){ D :: G(); }\n&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;\n\n&lt;p&gt;こうするといい感じ。&lt;/p&gt;\n\n&lt;p&gt;( ´゚д゚`)えーーー&lt;/p&gt;\n\n&quot;,
  &quot;output&quot;: &quot;&lt;!DOCTYPE html&gt;\n&lt;html lang=\&quot;ja\&quot;&gt;\n  &lt;head&gt;\n  &lt;meta http-equiv=\&quot;Content-type\&quot; content=\&quot;text/html; charset=utf-8\&quot;&gt;\n  &lt;meta name=\&quot;viewport\&quot; content=\&quot;width=device-width, initial-scale=1\&quot;&gt;\n  \n  &lt;meta name=\&quot;keywords\&quot; content=\&quot;C++,inheritance,instance,pure,virtual,virtual function table\&quot;&gt;\n\n\n  &lt;title&gt;基底クラスのメンバ関数を呼び出したいんだけど・・・&lt;/title&gt;\n\n  &lt;!-- bootstrap and jQuery include --&gt;\n  &lt;link rel=\&quot;stylesheet\&quot; href=\&quot;https://leico.github.io/TechnicalNote/css/style.css\&quot;&gt;\n  &lt;script type=\&quot;text/javascript\&quot; src=\&quot;https://leico.github.io/TechnicalNote/js/jquery-3.1.1.min.js\&quot;&gt;&lt;/script&gt;\n  &lt;script type=\&quot;text/javascript\&quot; src=\&quot;https://leico.github.io/TechnicalNote/js/bootstrap/bootstrap.min.js\&quot;&gt;&lt;/script&gt;\n  &lt;!-- bootstrap and jQuery include --&gt;\n\n  &lt;!-- MathJax include --&gt;\n  &lt;script type=\&quot;text/javascript\&quot; src=\&quot;https://leico.github.io/TechnicalNote/js/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML\&quot;&gt;&lt;/script&gt;\n\n  &lt;!-- Google Analytics --&gt;\n  &lt;script&gt;\n    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n    \n    ga('create', 'UA-100782315-1', 'auto');\n    ga('send', 'pageview');\n  &lt;/script&gt;\n\n  &lt;!-- Atom feed --&gt;\n  &lt;link type=\&quot;application/atom+xml\&quot; rel=\&quot;alternate\&quot; href=\&quot;https://leico.github.io/TechnicalNote/atom.xml\&quot; title=\&quot;TechnicalNote\&quot; /&gt;\n&lt;/head&gt;\n\n\n  &lt;body&gt;\n    &lt;div class=\&quot;container\&quot;&gt;\n    &lt;div class=\&quot;row\&quot;&gt;\n\n\n  &lt;div class=\&quot;col-md-8\&quot;&gt;\n\n    &lt;header class=\&quot;page-header\&quot;&gt;\n      &lt;h1&gt;基底クラスのメンバ関数を呼び出したいんだけど・・・&lt;/h1&gt;\n      &lt;div class=\&quot;row\&quot;&gt;\n\n        &lt;div class=\&quot;col-6\&quot;&gt;\n          &lt;dl class=\&quot;dl-horizontal\&quot;&gt;\n            &lt;dt&gt;created&lt;/dt&gt;\n            &lt;dd&gt;2016-09-13&lt;/dd&gt;\n            &lt;dt&gt;last change&lt;/dt&gt;\n            &lt;dd&gt;2017-03-05 23:59:01 +0000&lt;/dd&gt;\n          &lt;/dl&gt;\n        &lt;/div&gt;\n\n        &lt;div class=\&quot;col-6 text-right\&quot;&gt;\n          &lt;a href=\&quot;https://twitter.com/share\&quot; class=\&quot;twitter-share-button\&quot;&gt;Tweet&lt;/a&gt;\n          &lt;script&gt;!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');&lt;/script&gt;\n        &lt;/div&gt;\n\n      &lt;/div&gt;\n    &lt;/header&gt;\n\n    &lt;div class=\&quot;row\&quot;&gt;\n\n      &lt;div class=\&quot;col-12\&quot;&gt;\n        &lt;h2 id=\&quot;classh\&quot;&gt;class.h&lt;/h2&gt;\n\n&lt;div class=\&quot;language-cpp highlighter-rouge\&quot;&gt;&lt;div class=\&quot;highlight\&quot;&gt;&lt;pre class=\&quot;highlight\&quot;&gt;&lt;code&gt;&lt;span class=\&quot;k\&quot;&gt;class&lt;/span&gt; &lt;span class=\&quot;nc\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;{&lt;/span&gt;\n  &lt;span class=\&quot;k\&quot;&gt;public&lt;/span&gt;&lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt;\n             &lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;~&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;=&lt;/span&gt; &lt;span class=\&quot;mi\&quot;&gt;0&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;=&lt;/span&gt; &lt;span class=\&quot;mi\&quot;&gt;0&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;=&lt;/span&gt; &lt;span class=\&quot;mi\&quot;&gt;0&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n&lt;span class=\&quot;p\&quot;&gt;};&lt;/span&gt;\n\n&lt;span class=\&quot;k\&quot;&gt;class&lt;/span&gt; &lt;span class=\&quot;nc\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt; &lt;span class=\&quot;k\&quot;&gt;public&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;{&lt;/span&gt;\n\n  &lt;span class=\&quot;k\&quot;&gt;public&lt;/span&gt;&lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt;\n             &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;~&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n&lt;span class=\&quot;p\&quot;&gt;};&lt;/span&gt;\n\n&lt;span class=\&quot;k\&quot;&gt;class&lt;/span&gt; &lt;span class=\&quot;nc\&quot;&gt;E&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt; &lt;span class=\&quot;k\&quot;&gt;public&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;{&lt;/span&gt;\n\n  &lt;span class=\&quot;k\&quot;&gt;public&lt;/span&gt;&lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt;\n             &lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;~&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n    &lt;span class=\&quot;k\&quot;&gt;virtual&lt;/span&gt; &lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;);&lt;/span&gt;\n\n&lt;span class=\&quot;p\&quot;&gt;};&lt;/span&gt;\n&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;\n\n&lt;h2 id=\&quot;classcpp\&quot;&gt;class.cpp&lt;/h2&gt;\n\n&lt;div class=\&quot;language-cpp highlighter-rouge\&quot;&gt;&lt;div class=\&quot;highlight\&quot;&gt;&lt;pre class=\&quot;highlight\&quot;&gt;&lt;code&gt;&lt;span class=\&quot;cp\&quot;&gt;#include &amp;lt;iostream&amp;gt;\n&lt;/span&gt;&lt;span class=\&quot;k\&quot;&gt;using&lt;/span&gt; &lt;span class=\&quot;k\&quot;&gt;namespace&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;std&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n\n&lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt;  &lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;~&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){}&lt;/span&gt;\n\n&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt;  &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(){}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;~&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt;      &lt;span class=\&quot;p\&quot;&gt;{}&lt;/span&gt;\n\n&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;cout&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=\&quot;s\&quot;&gt;\&quot;D :: F\&quot;&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;endl&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt; &lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt; &lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt; &lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n\n&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt;  &lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;:&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(){}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;~&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;)&lt;/span&gt;      &lt;span class=\&quot;p\&quot;&gt;{}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;cout&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=\&quot;s\&quot;&gt;\&quot;E :: F\&quot;&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;endl&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt; &lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt; &lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n&lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;D&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;::&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt; &lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;\n\n&lt;h2 id=\&quot;maincpp\&quot;&gt;main.cpp&lt;/h2&gt;\n\n&lt;div class=\&quot;language-cpp highlighter-rouge\&quot;&gt;&lt;div class=\&quot;highlight\&quot;&gt;&lt;pre class=\&quot;highlight\&quot;&gt;&lt;code&gt;&lt;span class=\&quot;cp\&quot;&gt;#include &amp;lt;iostream&amp;gt;\n&lt;/span&gt;&lt;span class=\&quot;k\&quot;&gt;using&lt;/span&gt; &lt;span class=\&quot;k\&quot;&gt;namespace&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;std&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n\n&lt;span class=\&quot;kt\&quot;&gt;int&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;main&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;(&lt;/span&gt;&lt;span class=\&quot;kt\&quot;&gt;void&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;){&lt;/span&gt;\n  &lt;span class=\&quot;n\&quot;&gt;C&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;*&lt;/span&gt;&lt;span class=\&quot;n\&quot;&gt;c&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;=&lt;/span&gt; &lt;span class=\&quot;k\&quot;&gt;new&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;E&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt;\n\n  &lt;span class=\&quot;n\&quot;&gt;c&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;F&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt;\n  &lt;span class=\&quot;n\&quot;&gt;c&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;G&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt;\n  &lt;span class=\&quot;n\&quot;&gt;c&lt;/span&gt; &lt;span class=\&quot;o\&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;H&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;();&lt;/span&gt;\n\n  &lt;span class=\&quot;k\&quot;&gt;delete&lt;/span&gt; &lt;span class=\&quot;n\&quot;&gt;c&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n  &lt;span class=\&quot;k\&quot;&gt;return&lt;/span&gt; &lt;span class=\&quot;mi\&quot;&gt;0&lt;/span&gt;&lt;span class=\&quot;p\&quot;&gt;;&lt;/span&gt;\n&lt;span class=\&quot;p\&quot;&gt;}&lt;/span&gt;\n&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;\n\n&lt;p&gt;これが、&lt;/p&gt;\n\n&lt;h2 id=\&quot;output\&quot;&gt;output&lt;/h2&gt;\n\n&lt;div class=\&quot;highlighter-rouge\&quot;&gt;&lt;div class=\&quot;highlight\&quot;&gt;&lt;pre class=\&quot;highlight\&quot;&gt;&lt;code&gt;D :: F\nE :: F\nD :: F\nE :: F\nD :: F\nE :: F\n&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;\n\n&lt;p&gt;こうなる。&lt;/p&gt;\n\n&lt;div class=\&quot;highlighter-rouge\&quot;&gt;&lt;div class=\&quot;highlight\&quot;&gt;&lt;pre class=\&quot;highlight\&quot;&gt;&lt;code&gt;E :: F -&amp;gt; D :: F\nE :: G -&amp;gt; D :: G -&amp;gt; E :: F -&amp;gt; D :: F\nE :: H -&amp;gt; D :: H -&amp;gt; E :: G -&amp;gt; D :: G -&amp;gt; E :: F -&amp;gt; D :: F\n&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;\n\n&lt;p&gt;と呼び出されているようだ。つまり、\n&lt;code class=\&quot;highlighter-rouge\&quot;&gt;D :: G()&lt;/code&gt;で呼び出している&lt;code class=\&quot;highlighter-rouge\&quot;&gt;F()&lt;/code&gt;は&lt;code class=\&quot;highlighter-rouge\&quot;&gt;E :: F()&lt;/code&gt;になっていて、 &lt;code class=\&quot;highlighter-rouge\&quot;&gt;D :: H()&lt;/code&gt;で呼び出している&lt;code class=\&quot;highlighter-rouge\&quot;&gt;G()&lt;/code&gt;は&lt;code class=\&quot;highlighter-rouge\&quot;&gt;E :: G()&lt;/code&gt;になっている。&lt;/p&gt;\n\n&lt;p&gt;仮想関数テーブルってむずかし。&lt;/p&gt;\n\n&lt;div class=\&quot;highlighter-rouge\&quot;&gt;&lt;div class=\&quot;highlight\&quot;&gt;&lt;pre class=\&quot;highlight\&quot;&gt;&lt;code&gt;D :: F(void){ cout &amp;lt;&amp;lt; \&quot;D :: F\&quot; &amp;lt;&amp;lt; endl; }\nD :: G(void){ D :: F(); }\nD :: H(void){ D :: G(); }\n&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;\n\n&lt;p&gt;こうするといい感じ。&lt;/p&gt;\n\n&lt;p&gt;( ´゚д゚`)えーーー&lt;/p&gt;\n\n\n      &lt;/div&gt;\n\n      &lt;div class=\&quot;col-12\&quot;&gt;\n        &lt;hr&gt;\n        &lt;a href=\&quot;https://twitter.com/share\&quot; class=\&quot;twitter-share-button\&quot;&gt;Tweet&lt;/a&gt;\n        &lt;script&gt;!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');&lt;/script&gt;\n      &lt;/div&gt;\n\n    &lt;/div&gt;\n\n  &lt;/div&gt;\n  \n    &lt;div class=\&quot;col-md-4\&quot;&gt;\n      &lt;h2&gt;\n        &lt;a href=\&quot;https://leico.github.io/TechnicalNote/\&quot;&gt;\n          Technical Note\n        &lt;/a&gt;\n      &lt;/h2&gt;\n\n      \n\n      \n\n      &lt;h3&gt;\n        &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp\&quot;&gt;C++ Top&lt;/a&gt;\n      &lt;/h3&gt;\n\n      \n        &lt;h3&gt;C++11 Tips&lt;/h3&gt;\n        &lt;ul&gt;\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/template-template-parameter\&quot;&gt;テンプレートテンプレートパラメータまとめ&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/is-same-base-of\&quot;&gt;std :: is_same と std :: is_base_of の挙動を調べる&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/private-using\&quot;&gt;using や typedef にもアクセス指定子が乗る&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/enum-class-operator\&quot;&gt;enum class 同士の計算を僕も実装してみた&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/template-specialize-inherit\&quot;&gt;クラステンプレートの特殊化ごとに継承元を変更する&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/variadic-template\&quot;&gt;可変引数テンプレートパラメータいろいろ&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/using_error\&quot;&gt;std :: conditional の判定式でエラー&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/cast_specialization\&quot;&gt;テンプレート型変換演算子を特殊化する&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/has_trivial_assign\&quot;&gt;has_trivial_assign は is_trivially_copy_assignable になった&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/lambda\&quot;&gt;ラムダ式を利用する&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n        &lt;/ul&gt;\n      \n        &lt;h3&gt;Tips&lt;/h3&gt;\n        &lt;ul&gt;\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/overload-cast\&quot;&gt;キャスト演算子のオーバーロード&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/accessor\&quot;&gt;アクセサ&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/Explicit-specialization-of-after-instantiation\&quot;&gt;Explicit specialization of “ after instantiation&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/part-of-specialize\&quot;&gt;特定のメンバ関数だけ特殊化&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/template-specialization\&quot;&gt;テンプレート特殊化の入り口&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/inherited-interface\&quot;&gt;インターフェイスを継承して新しいインターフェイスを作る&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/call-base-class-function\&quot;&gt;基底クラスのメンバ関数を呼び出したいんだけど・・・&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/not-definit-const-static-in-header\&quot;&gt;const static なメンバ変数の実装はヘッダファイルで行わない&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/pure-virtual-definition\&quot;&gt;純粋仮想関数は定義を持てる&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n\n          \n\n          \n          \n\n          &lt;li&gt;\n            &lt;a href=\&quot;https://leico.github.io/TechnicalNote/Cpp/interface-test\&quot;&gt;インターフェイスの実験&lt;/a&gt;\n          &lt;/li&gt;\n\n        \n        &lt;/ul&gt;\n      \n    &lt;/div&gt;\n  \n\n&lt;/div&gt;\n\n    &lt;/div&gt;\n    &lt;footer class=\&quot;container\&quot;&gt;\n  &lt;hr&gt;\n  &lt;div class=\&quot;row\&quot;&gt;\n    &lt;div class=\&quot;col\&quot;&gt;\n      &lt;p class=\&quot;text-right\&quot;&gt;\n      &lt;a href=\&quot;https://leico.github.io/TechnicalNote/atom.xml\&quot;&gt;Atom&lt;/a&gt;\n      &lt;/p&gt;\n    &lt;/div&gt;\n  &lt;/div&gt;\n  &lt;div class=\&quot;row\&quot;&gt;\n    &lt;div class=\&quot;col-md-8\&quot;&gt;\n      &lt;div class=\&quot;row\&quot;&gt;\n        &lt;div class=\&quot;col-md-4\&quot;&gt;\n          &lt;figure class=\&quot;figure\&quot;&gt;\n            &lt;img src=\&quot;https://leico.github.io/TechnicalNote/image/logo.png\&quot; class=\&quot;figure-img rounded\&quot; width=\&quot;200px\&quot; height=\&quot;auto\&quot; alt=\&quot;\&quot;&gt;\n          &lt;/figure&gt;\n        &lt;/div&gt;\n        &lt;div class=\&quot;col-md-4\&quot;&gt;\n          &lt;h5&gt;contact&lt;/h5&gt;\n          &lt;ul class=\&quot;list-unstyled\&quot;&gt;\n            &lt;li&gt; &lt;a href=\&quot;https://github.com/leico\&quot; class=\&quot;user-mention\&quot;&gt;@leico&lt;/a&gt; &lt;/li&gt;\n            &lt;li&gt; &lt;a href=\&quot;https://www.twitter.com/1_0101\&quot;&gt;twitter&lt;/a&gt;\n&lt;/li&gt;\n            &lt;li&gt; &lt;a href=\&quot;https://leico.github.io\&quot;&gt;web&lt;/a&gt;\n          &lt;/li&gt;\n&lt;/ul&gt;\n        &lt;/div&gt;\n      &lt;/div&gt;\n    &lt;/div&gt;\n    &lt;div class=\&quot;col-md-4\&quot;&gt;\n      &lt;h5&gt;Merchandise/Schwags&lt;/h5&gt;\n      &lt;p&gt;&lt;small class=\&quot;text-muted\&quot;&gt;支援してくれるとうれしい&lt;/small&gt;&lt;/p&gt;\n      &lt;iframe frameborder=\&quot;0\&quot; height=\&quot;220\&quot; width=\&quot;160\&quot; src=\&quot;https://leico.official.ec/items/6694858/widget/small\&quot;&gt;&lt;/iframe&gt;\n    &lt;/div&gt;\n  &lt;/div&gt;\n  &lt;p class=\&quot;text-right\&quot;&gt;\n    &lt;small class=\&quot;text-muted\&quot;&gt;© 2017 leico.&lt;/small&gt;\n  &lt;/p&gt;\n\n&lt;/footer&gt;\n\n  &lt;/body&gt;\n&lt;/html&gt;\n&quot;,
  &quot;id&quot;: &quot;/Cpp/call-base-class-function&quot;,
  &quot;previous&quot;: {
    &quot;id&quot;: &quot;/Cpp/accessor&quot;,
    &quot;url&quot;: &quot;/Cpp/accessor&quot;,
    &quot;relative_path&quot;: &quot;_docs/Cpp/accessor.md&quot;,
    &quot;collection&quot;: &quot;docs&quot;,
    &quot;path&quot;: &quot;_docs/Cpp/accessor.md&quot;,
    &quot;draft&quot;: false,
    &quot;categories&quot;: [

    ],
    &quot;layout&quot;: &quot;post&quot;,
    &quot;title&quot;: &quot;アクセサ&quot;,
    &quot;date&quot;: &quot;2016-09-13 00:00:00 +0900&quot;,
    &quot;lastchange&quot;: &quot;2017-03-06 01:21:10 +0000&quot;,
    &quot;tags&quot;: [
      &quot;C++&quot;,
      &quot;class&quot;,
      &quot;member&quot;,
      &quot;overload&quot;,
      &quot;accessor&quot;
    ],
    &quot;slug&quot;: &quot;accessor&quot;,
    &quot;ext&quot;: &quot;.md&quot;
  },
  &quot;url&quot;: &quot;/Cpp/call-base-class-function&quot;,
  &quot;relative_path&quot;: &quot;_docs/Cpp/call-base-class-function.md&quot;,
  &quot;collection&quot;: &quot;docs&quot;,
  &quot;next&quot;: {
    &quot;id&quot;: &quot;/Cpp/inherited-interface&quot;,
    &quot;url&quot;: &quot;/Cpp/inherited-interface&quot;,
    &quot;relative_path&quot;: &quot;_docs/Cpp/inherited-interface.md&quot;,
    &quot;collection&quot;: &quot;docs&quot;,
    &quot;path&quot;: &quot;_docs/Cpp/inherited-interface.md&quot;,
    &quot;draft&quot;: false,
    &quot;categories&quot;: [

    ],
    &quot;layout&quot;: &quot;post&quot;,
    &quot;title&quot;: &quot;インターフェイスを継承して新しいインターフェイスを作る&quot;,
    &quot;date&quot;: &quot;2016-09-13 00:00:00 +0900&quot;,
    &quot;lastchange&quot;: &quot;2017-03-06 00:03:14 +0000&quot;,
    &quot;tags&quot;: [
      &quot;C++&quot;,
      &quot;inheritance&quot;,
      &quot;interface&quot;,
      &quot;pure&quot;,
      &quot;virtual&quot;
    ],
    &quot;slug&quot;: &quot;inherited-interface&quot;,
    &quot;ext&quot;: &quot;.md&quot;
  },
  &quot;path&quot;: &quot;_docs/Cpp/call-base-class-function.md&quot;,
  &quot;excerpt&quot;: &quot;&lt;h2 id=\&quot;classh\&quot;&gt;class.h&lt;/h2&gt;\n\n&quot;,
  &quot;draft&quot;: false,
  &quot;categories&quot;: [

  ],
  &quot;layout&quot;: &quot;post&quot;,
  &quot;title&quot;: &quot;基底クラスのメンバ関数を呼び出したいんだけど・・・&quot;,
  &quot;date&quot;: &quot;2016-09-13 00:00:00 +0900&quot;,
  &quot;lastchange&quot;: &quot;2017-03-05 23:59:01 +0000&quot;,
  &quot;tags&quot;: [
    &quot;C++&quot;,
    &quot;inheritance&quot;,
    &quot;instance&quot;,
    &quot;pure&quot;,
    &quot;virtual&quot;,
    &quot;virtual function table&quot;
  ],
  &quot;slug&quot;: &quot;call-base-class-function&quot;,
  &quot;ext&quot;: &quot;.md&quot;
},
&quot;path&quot;: &quot;_docs/Cpp/accessor.md&quot;,
&quot;excerpt&quot;: &quot;&lt;p&gt;C++でメンバ変数へのアクセサを作る場合、最近こうやっている。&lt;/p&gt;\n\n&quot;,
&quot;draft&quot;: false,
&quot;categories&quot;: [

],
&quot;layout&quot;: &quot;post&quot;,
&quot;title&quot;: &quot;アクセサ&quot;,
&quot;date&quot;: &quot;2016-09-13 00:00:00 +0900&quot;,
&quot;lastchange&quot;: &quot;2017-03-06 01:21:10 +0000&quot;,
&quot;tags&quot;: [
  &quot;C++&quot;,
  &quot;class&quot;,
  &quot;member&quot;,
  &quot;overload&quot;,
  &quot;accessor&quot;
],
&quot;slug&quot;: &quot;accessor&quot;,
&quot;ext&quot;: &quot;.md&quot;   },   &quot;path&quot;: &quot;_docs/Cpp/Explicit-specialization-of-after-instantiation.md&quot;,   &quot;excerpt&quot;: &quot;&lt;h2 id=\&quot;maincpp\&quot;&gt;main.cpp&lt;/h2&gt;\n\n&quot;,   &quot;draft&quot;: false,   &quot;categories&quot;: [

], "layout": "post", "title": "Explicit specialization of “ after instantiation", "date": "2016-09-13 00:00:00 +0900", "lastchange": "2017-03-06 00:13:17 +0000", "tags": [ "C++", "genelic", "programming", "template", "meta" ], "slug": "Explicit-specialization-of-after-instantiation", "ext": ".md" }

{ "modified_time": "2018-08-31 21:30:51 +0900", "path": "_docs/Max/images/poly-summary/06-prefix.png", "name": "06-prefix.png", "collection": "docs", "basename": "06-prefix", "extname": ".png" }

"_docs"

nil

true

docsがsite.html_pagessite.postsのようなものになるらしい。 各々のCollectionを区別する方法はlabelrelative_directoryを用いるのがよさそう。