title: How do I resolve error: 'iterator' was not declared in this scope?
body: <p>I have a header file in which I declare <code>typedef std::pair&lt;iterator, iterator&gt; it_pair_t;</code> inside of <code>extern "C"</code>. Outside of the <code>extern "C"</code>, I include <code>&lt;iterator&gt;</code>.</p>
  
  <p>I have tried moving <code>#include &lt;iterator&gt;</code> into the <code>extern "C"</code>. I have also tried using <code>typename</code> instead of <code>typedef</code>.</p>
  
  <pre><code>#ifdef __cplusplus 
  #include &lt;iterator&gt;
  extern "C" {    
      typedef std::pair&lt;iterator, iterator&gt; it_pair_t;
  #ifdef __cplusplus
  }
  </code></pre>