title: C++ template type that can be stored in a std::map and then exposing the map publicly
body: <p>I have a class myclass that has a private member param_map</p>
  
  <pre><code>class some_class {
  
   private:
    std::map&lt;std::string,std::shared_ptr&lt;parameter&gt; &gt; param_map;
  };
  </code></pre>
  
  <p>I want to expose this map to allow other classes, I have already created add, delete, get parameter methods, which do, what you think.  But I would like to expose this so other classes can traverse the map.</p>
  
  <p>Q1: What would be the safest way to do this.</p>
  
  <p>parameter also has a member value that I want to be either int/float/bool so one option would be to define it using templates</p>
  
  <pre><code>template&lt;class T&gt;
  class parameter {
    public:
     T get_value { return value_; }
  
    private:
     T value_;
  }
  </code></pre>
  
  <p>Q2: But how would I store this type in the map? And how would it change the definition of param_map. Also I would consider non template solutions (But I would prefer just one map)</p>
  
  <p>PS: I would rather avoid using boost, I prefer to use the c++x0 std lib, but if boost is the best option then I will consider that.  It would be good if you could post code examples also.</p>
  
  <p>Regards</p>
  
  <p>Mark</p>