<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>higepon</author_name>
  <author_url>https://blog.hatena.ne.jp/higepon/</author_url>
  <blog_title>higepon blog</blog_title>
  <blog_url>https://higepon.hatenablog.com/</blog_url>
  <categories>
    <anon>c++</anon>
  </categories>
  <description>C++の class template を使えば static メンバの実体がヘッダファイルに書けるというテクニックがある。考えてみると不思議な動作に思える。だって分割コンパイルしたら実体が複数個出来そうじゃない？。この裏側で起こっている事を実験前に予想して試したところ、予想通りだったのでうれしかったのでメモを残す。 以下実験。 環境 g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3。Windows は試してない。 Hoge.h class template で static メンバの実体をヘッダに書く。 #include &lt;stdio.h&gt; template &lt;typena…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhigepon.hatenablog.com%2Fentry%2F20100803%2F1280834422&quot; title=&quot; C++の class template を使えば static メンバの実体がヘッダファイルに書けるカラクリ - higepon blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2010-08-03 20:20:22</published>
  <title> C++の class template を使えば static メンバの実体がヘッダファイルに書けるカラクリ</title>
  <type>rich</type>
  <url>https://higepon.hatenablog.com/entry/20100803/1280834422</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
