title: Map with Classname as Key
body: <p>Is it possible to somehow use a class name as key in a container?</p>
  
  <p>I want to store objects of classes inherited from the same base.</p>
  
  <pre><code>struct storage {};
  
  struct storagetransform : public storage
  {
      vec3 position, rotation;
  };
  
  struct storageform : public storage
  {
      unsigned int vertex, texture;
  };
  </code></pre>
  
  <p>I have a nested map. The <code>...</code> should be filled with the specific class name like <code>storagetransform</code> or <code>storageform</code> as a type or string or whatever.</p>
  
  <pre><code>unordered_map&lt;..., unordered_map&lt;int, storage*&gt; &gt; list;
  </code></pre>
  
  <p>I want to access the object of the container like the following.</p>
  
  <pre><code>list[storagetransform](1337);
  </code></pre>
  
  <p>It this possible somehow? Moreover is there a better approach for this problem?</p>