title: C++: How to get iterator type from defined container object
body: <p>I have a code In a form:</p>
  
  <pre><code>unordered_set&lt;pair&lt;int,int&gt;,CustomHash&gt; Edges;
  typedef unordered_set&lt;pair&lt;int,int&gt;,CustomHash&gt;::iterator EdgesIt;
  ...
  for(auto it=Edges.begin();it!=Edges.end();it++){
      list&lt;EdgesIt&gt; List;
  }
  </code></pre>
  
  <p>etc. How can I avoid defining a new type EdgesIt to be used in List declaration and get it in some smarter way, for example:</p>
  
  <pre><code>list&lt;Edges::iterator_type&gt; List;
  </code></pre>
  
  <p>InteliSense only suggests <code>Edges::iterator</code> which is defined as <code>typedef std::iterator pair&lt;int,int&gt; iterator</code>. More to say, it doesn't work. I also tried to use <code>unordered_set::iterator</code>, but it also doesn't work.</p>