title: C++ Incompatible iterators types
body: <p>I tried to print a graph and the compiler thew an error.</p>
  
  <p>The error goes like this:
  class "__gnu_cxx::__normal_iterator, std::allocator>> *, std::vector, std::allocator>>, std::allocator, std::allocator>>>>>" has no member "begin"</p>
  
  <p>The same happens with an end().</p>
  
  <p>Here is the code:</p>
  
  <pre><code>void printGraph(std::vector&lt;std::list&lt;std::pair&lt;int, int&gt;&gt;&gt; graph)
  {
      for (std::vector&lt;std::list&lt;std::pair&lt;int, int&gt;&gt;&gt;::iterator i = graph.begin(); i &lt; graph.end(); i++)
      {
          for (std::list&lt;std::pair&lt;int, int&gt;&gt;::iterator j = i.begin(); j &lt; i.end(); j++)
              printf("%d", (*j).first);
          putchar('\n');
      }
  }
  </code></pre>