title: Can I store a typename?
body: <p>Here is my example class for accessing memory:</p>
  
  <pre><code>class memory {
    public:
      memory();
  
      template &lt;typename T&gt;
      T get(int index);
      template &lt;typename T&gt;
      void set(int index, T value);
  };
  </code></pre>
  
  <p>And here I use it:</p>
  
  <pre><code>int main(){
    memory mem;
  
    float f = mem.get&lt;float&gt;(0);
    char* str = mem.get&lt;char*&gt;(1);
  
    mem.set&lt;float&gt;(0, 25);  // int passed, upgraded to float
  
    return 0;
  }
  </code></pre>
  
  <p>And I'd like to use it this way:</p>
  
  <pre><code>int main(){
    memory&lt;float, char*&gt; mem;  // typenames defined only once. Must accept a variable number of template arguments
  
    float f = mem.get(0);
    char* str = mem.get(1);
  
    mem.set(0, 25);  // int passed, upgraded to float
  
    return 0;
  }
  </code></pre>
  
  <p>How can I implement this? Is it even possible?</p>