Why does using the true value of the iterator err?
<p>I am instantiating an iterator within a method in one of my templates. It works when I use <code>auto</code> to dynamically obtain type information:</p>

<pre><code>auto itr = my_list.cbegin();
</code></pre>

<p>However, I get a compile-time error when I use the actual type:</p>

<pre><code>typedef InternalEdge network_internal_edge_type;
typedef std::shared_ptr&lt; network_internal_edge_type &gt; network_shared_edge_ptr;
typedef std::list&lt; network_shared_edge_ptr &gt; network_internal_edge_store_type;

network_internal_edge_store_type::const_iterator itr = internal_edges_.cbegin();
</code></pre>

<p><code>InternalEdge</code> is a private class I had defined somewhere above in the code.
Here is the error:</p>

<pre><code>Network.hpp:411:5: error: need ‘typename’ before ‘Network&lt;V&gt;::internal_edge_store_mechanism:: const_iterator’ because ‘Network&lt;V&gt;::internal_edge_store_mechanism’ is a dependent scope
Network.hpp:411:46: error: expected ‘;’ before ‘itr’
Network.hpp:412:12: error: ‘itr’ was not declared in this scope
</code></pre>

<p>Why does using <code>auto</code> make the code work? Why does the compiler think I need "typename"?</p>
