title: C++ error declaring std::pair inside template class
body: <p>I want to avoid using the <code>std::pair()</code> constructor or <code>std::make_pair()</code> functions while inserting into a <code>map</code>. I also want to know the success status of the insert operation, so I cannot use <code>operator[]</code>. I tried the following code but it produces a compile error. </p>
  
  <pre><code>template&lt;typename TKey, typename TVal&gt;
  class Map
  {
     private :
        std::map&lt;TKey, TVal&gt; m_holder;
  
     public :
        bool insert(TKey key, TVal val)
        {
           std::pair&lt;std::map&lt;TKey, TVal&gt;::iterator, bool&gt; ret;
           /* ret = m_holder.insert(std::make_pair(key, val)); */
           return 0;
        }
  };
  
  int main()
  {
     return 0;
  }
  </code></pre>
  
  <p>Error :</p>
  
  <pre><code>Hello.cpp: In member function `bool Map&lt;TKey, TVal&gt;::insert(TKey, TVal)':
  Hello.cpp:13: error: type/value mismatch at argument 1 in template parameter list for `template&lt;class _T1, class _T2&gt; struct std::pair'
  Hello.cpp:13: error:   expected a type, got ` std::map&lt;TKey,TVal,std::less&lt;_Key&gt;,std::allocator&lt;std::pair&lt;const _Key, _Tp&gt; &gt; &gt;::iterator'
  Hello.cpp:13: error: invalid type in declaration before ';' token
  </code></pre>
  
  <p>Help me solve the problem.</p>