title: C++ template class map
body: <p>I add the constructor and two functions to the class of my previous linked question <a href="https://stackoverflow.com/questions/8413222/c-iterate-through-a-template-map">C++ iterate through a template Map</a> and I need help at this points:</p>
  
  <ul>
  <li>What do you reckon this constructor does?</li>
  <li>Adding one value at the beginning of map?</li>
  <li>I see though in the respective key only an address as value after initializing in main. What is wrong? </li>
  </ul>
  
  <p>The operator [] is supposed to get the values for a specific key. However I cannot use it so as to get the elements of the map in the output. Any hint? </p>
  
  <pre><code>template&lt;class K, class V&gt;
  class template_map{
  public:
      template_map( V const&amp; val) {
          m_map.insert(my_map.begin(),std::make_pair(std::numeric_limits&lt;K&gt;::min(),val));
      };    
  
      typedef typename std::map&lt;K,V&gt; TMap;
  
      TMap my_map;
      typedef typename TMap::const_iterator const_iterator;
      const_iterator begin() const { return my_map.begin(); }
      const_iterator end() const   { return my_map.end(); }
      V const&amp; operator[]( K const&amp; key ) const {
          return ( --my_map.upper_bound(key) )-&gt;second;
      }
  
      ...
  };
  
  int main()
  {
      interval_map&lt;int,int&gt; Map1 (10);
      //Show the elements of the map?
  }
  </code></pre>
  
  <p>Consider also that it should be a function that inserts values to the map.</p>