title: C++ std::map holding ANY type of value
body: <p>Basically I want MyClass that holds a Hashmap that maps Field name(string) to ANY type of 
  Value.. For this purpose I wrote a separate MyField class that holds the type &amp; value information..</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>template &lt;typename T&gt;
  class MyField {
      T m_Value;
      int m_Size;
  }
  
  
  struct MyClass {
      std::map&lt;string, MyField&gt; fields;   //ERROR!!!
  }
  </code></pre>
  
  <p>But as you can see, the map declaration fails because I didn't provide the type parameter for MyField...</p>
  
  <p>So I guess It has to be something like</p>
  
  <pre><code>std::map&lt; string, MyField&lt;int&gt; &gt; fields;
  </code></pre>
  
  <p>or </p>
  
  <pre><code>std::map&lt; string, MyField&lt;double&gt; &gt; fields;
  </code></pre>
  
  <p><br></p>
  
  <p>But obviously this undermines my whole purpose, because the declared map can only hold MyField of a specific type.. I want a map that can hold ANY type of MyField clas..</p>
  
  <p>Is there any way I can achieve this..?</p>