title: Iterate over vector of pair
body: <p>I have written following code snippet but it does not seem to be working.</p>
  
  <pre><code>int main(){
      int VCount, v1, v2;
      pair&lt;float, pair&lt;int,int&gt; &gt; edge;
      vector&lt; pair&lt;float, pair&lt;int,int&gt; &gt; &gt; edges;
      float w;
      cin &gt;&gt; VCount;
      while( cin &gt;&gt; v1 ){
          cin &gt;&gt; v2 &gt;&gt; w;
          edge.first = w;
          edge.second.first = v1;
          edge.second.second = v2;
          edges.push_back(edge);
      }
      sort(edges.begin(), edges.end());
      for ( vector &lt; pair&lt;float,pair&lt;int,int&gt;&gt; &gt;::const_iterator it = edges.begin() ; itt != edges.end; it++){
          cout &gt;&gt; it.first;
      }
      return 0;
  }
  </code></pre>
  
  <p>It is throwing an error at the line containing for loop. The error is:</p>
  
  <pre><code>error: no match for ‘operator&lt;’ in ‘it &lt; edges.std::vector&lt;_Tp, _Alloc&gt;::end [with _Tp = std::pair&lt;float, std::pair&lt;int, int&gt; &gt;, _Alloc = std::allocator&lt;std::pair&lt;float, std::pair&lt;int, int&gt; &gt; &gt;, std::vector&lt;_Tp, _Alloc&gt;::const_iterator = __gnu_cxx::__normal_iterator&lt;const std::pair&lt;float, std::pair&lt;int, int&gt; &gt;*, std::vector&lt;std::pair&lt;float, std::pair&lt;int, int&gt; &gt; &gt; &gt;, typename std::_Vector_base&lt;_Tp, _Alloc&gt;::_Tp_alloc_type::const_pointer = const std::pair&lt;float, std::pair&lt;int, int&gt; &gt;*]
  </code></pre>
  
  <p>Can anyone help me out?</p>