Unable to iterate through template map. How to deal with this error?
<p>I have a graph class that employs two dimension vertices using a map with another map nested inside, as such(V is my template):</p>

<pre><code>map&lt; V , map&lt;  V , int&gt; &gt; vertices;
</code></pre>

<p>Defining an iterator as such seems to be ok:</p>

<pre><code>typename map&lt; V, map&lt; V , int&gt;::iterator i;
</code></pre>

<p>However when I try to use that iterator, like this <code>i = vertices.begin()</code> , I get a long error that looks like this. (main.cpp 81 is where I call the method that does the iteration). Where could I look at to find what's wrong?</p>

<pre><code>main.cpp:81:   instantiated from here
graph.h:326: error: no match for ‘operator=’ in ‘i = ((const GraphNameSpace::Graph&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;*)this)-&gt;GraphNameSpace::Graph&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;,      std::allocator&lt;char&gt; &gt; &gt;::vertices.std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::begin [with _Key = std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, _Tp = std::map&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, int, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;std::pair&lt;const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, int&gt; &gt; &gt;, _Compare = std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, _Alloc = std::allocator&lt;std::pair&lt;const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::map&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, int, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;std::pair&lt;const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, int&gt; &gt; &gt; &gt; &gt;]()’
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_tree.h:152: note: candidates are: std::_Rb_tree_iterator&lt;std::pair&lt;const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::map&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, int, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;std::pair&lt;const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, int&gt; &gt; &gt; &gt; &gt;&amp; std::_Rb_tree_iterator&lt;std::pair&lt;const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::map&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, int, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;std::pair&lt;const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, int&gt; &gt; &gt; &gt; &gt;::operator=(const std::_Rb_tree_iterator&lt;std::pair&lt;const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::map&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, int, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;std::pair&lt;const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, int&gt; &gt; &gt; &gt; &gt;&amp;)
make: *** [main.o] Error 1
</code></pre>

<p>UPDATE:
At the risk of providing too much information, here is my <a href="http://pastebin.com/TW5QM74Q" rel="nofollow">graph class on pastebin</a>. Right at the very bottom in the <code>dump</code> function is where I'm attempting to do the iteration.</p>
