title: c++ std::map class with generic key
body: <p>I have a family of classes, and each subclass needs a map but the keys will have different types, although they both will perform the exact same operations with the map. Also the value on both cases will be string.
  So far I have code similar to the example below, my goal is to reuse code, by
  having a generic key.
  Without using any additional libraries besides STL</p>
  
  <pre><code>class A{
   public:
      /*
       * More code
       */
  };
  
  
  class subA1 : public A{
  public:
      void insertValue(long id, std::string&amp; value){
          if(_theMap.find(id) == _theMap.end())
          {
              _theMap[id] = value;
          }
      }
  
   private:
       std::map&lt;long,std:string&gt; _theMap;
  };
  
  class subA2 : public A{
  public:
      void insertValue(std::string&amp; id, std::string&amp; value){
          if(_theMap.find(id) == _theMap.end())
          {
              _theMap[id] = value;
          }
      }
  private:
       std::map&lt;std::string,std:string&gt; _theMap;
  
  };
  </code></pre>