<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>agate_pris</author_name>
  <author_url>https://blog.hatena.ne.jp/agate_pris/</author_url>
  <blog_title>altebute.hatenablog.com</blog_title>
  <blog_url>https://altebute.hatenablog.com/</blog_url>
  <categories>
    <anon>C++</anon>
    <anon>programming</anon>
  </categories>
  <description>要素を指定したら自動で型を判別しダウンキャストする - 雑記 上記の記事では、基底クラス型のポインタの配列に対して、 任意の添え字に対して静的に型が決っている派生クラスのアドレスを保持し、 テンプレート関数を用いて派生クラスポインタ型のアドレスを取得している。 この記事を見てなんか違和感があったのでよく考えてみたのだが、 配列に入るオブジェクトの型をコンパイル時に決定しているのなら、 キャストをせずにアドレスを取得する事が可能な筈だ。 std::tupleを用いてアドレスを保持すれば良い。 上記の記事のコードを、単純にstd::tupleを用いたコードに変更すると、以下のようになる。 #inc…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Faltebute.hatenablog.com%2Fentry%2F2014%2F08%2F14%2F003813&quot; title=&quot;配列の代わりに std::tuple を使って不要なキャストを避ける - altebute.hatenablog.com&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>2014-08-14 00:38:13</published>
  <title>配列の代わりに std::tuple を使って不要なキャストを避ける</title>
  <type>rich</type>
  <url>https://altebute.hatenablog.com/entry/2014/08/14/003813</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
