<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kazuhooku</author_name>
  <author_url>https://blog.hatena.ne.jp/kazuhooku/</author_url>
  <blog_title>kazuhoのメモ置き場</blog_title>
  <blog_url>https://kazuhooku.hatenadiary.org/</blog_url>
  <categories>
    <anon>C++</anon>
  </categories>
  <description>クラスを定義するだけで、そのクラスインスタンスが自動的に作られて登録されたりすると便利ですよね。たとえば、ビルド構成によって組み込まれるモジュールが変わる場合に、そのモジュールを Makefile に含めるだけで自動的サービスクラスが初期化されて登録されるとうれしい。今回 getopt のラッパーを C++ で書いていて、そういうこと（有効な機能の設定オプションをハンドリングするサービスクラスが自動的に登録される）がやりたくなったので、書いてみた。こんな感じ。 template&lt;typename T&gt; class service_base { public: service_base() { …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkazuhooku.hatenadiary.org%2Fentry%2F20110204%2F1296819681&quot; title=&quot; class definition is initialization パターンって言えばいいのかしら。クラスを定義するだけでインスタンスを自動生成する方法 - kazuhoのメモ置き場&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>2011-02-04 20:41:21</published>
  <title> class definition is initialization パターンって言えばいいのかしら。クラスを定義するだけでインスタンスを自動生成する方法</title>
  <type>rich</type>
  <url>https://kazuhooku.hatenadiary.org/entry/20110204/1296819681</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
