title: "No match for operator= " when using an iterator of the same type
body: <p>I'm getting a ginormously long error message. I looked around and it means that my iterator is not the same type as the list it is iterating, but it looks the same to me!</p>
  
  <pre class="lang-cpp prettyprint-override"><code>template &lt;typename T1, typename T2&gt;
  class Map
  {
      public:
          Map();
          bool contains_key(const T1&amp; key) const;
      private:
          T1 key;
          T2 value;
          typedef list&lt;Pair&lt;T1, T2&gt; &gt; multiPair;
          multiPair pairList;
  };
  
  template&lt;typename T1, typename T2&gt;
  inline Map&lt;T1, T2&gt;::Map() { }
  
  template&lt;typename T1, typename T2&gt;
  bool Map&lt;T1, T2&gt;::contains_key(const T1&amp; key) const
  {
      typename multiPair::iterator pos;
      for(pos = pairList.begin(); pos != pairList.end(); pos++) //error
          if(*pos.get_first() == key)
              return true;
      return false;
  }
  </code></pre>
  
  <p>map1.h:83:31: error: no match for ‘operator=’ in ‘pos = ((const Map, std::basic_string >*)this)->Map, std::basic_string >::pairList.std::list&lt;_Tp, _Alloc>::begin with _Tp = Pair, std::basic_string >, _Alloc = std::allocator, std::basic_string > >, std::list&lt;_Tp, _Alloc>::const_iterator = std::_List_const_iterator, std::basic_string > >’
  /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/stl_list.h:114:5: note: candidate is: std::_List_iterator, std::basic_string > >&amp; std::_List_iterator, std::basic_string > >::operator=(const std::_List_iterator, std::basic_string > >&amp;)</p>