<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>asakawajunya</author_name>
  <author_url>https://blog.hatena.ne.jp/asakawajunya/</author_url>
  <blog_title>asakawajunyaのブログ</blog_title>
  <blog_url>https://asakawajunya.hatenablog.com/</blog_url>
  <categories>
    <anon>c++</anon>
    <anon>sample</anon>
    <anon>tips</anon>
  </categories>
  <description>あとで使おうと思って調べたので備忘録として。 create関数にクラス名を渡すと、オブジェクトを生成して返してくれる。 サンプルなのでnamespaceとかはなくても良かったが、実際使うときにはnamespaceも使うつもりだったので合わせて。 サンプルコード #include &lt;cstdio&gt; #include &lt;typeinfo&gt; namespace sample { template &lt;class T&gt; T* create() { T* obj = new T(); return obj; } } class AClazz {}; class BClazz {}; int main(in…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fasakawajunya.hatenablog.com%2Fentry%2F20110728%2F1311862326&quot; title=&quot; テンプレートのサンプルコード - asakawajunyaのブログ&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-07-28 23:12:06</published>
  <title> テンプレートのサンプルコード</title>
  <type>rich</type>
  <url>https://asakawajunya.hatenablog.com/entry/20110728/1311862326</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
