title: What is the C++ iterator for STL Queue?
body: <p>I know we can not iterate easily in STL Queue, but I want to do something like this:</p>
  <pre><code>void myFun(Node* root) {
      queue&lt;pair&lt;int, Node*&gt;&gt; myQueue;
      myQueue.push(make_pair(0, root));
      auto it = myQueue.front();
  }
  </code></pre>
  <p>This works, however, what should I use instead of the <code>auto</code> keyword for the queues?</p>
  <p>We use something like this for maps:</p>
  <pre><code>map&lt;int, Node*&gt;::iterator it = myMap.begin();
  </code></pre>
  <p>But</p>
  <pre><code>queue&lt;pair&lt;int, Node*&gt;&gt;::iterator it = myQueue.front(); 
  </code></pre>
  <p>This does not work and throws error:</p>
  <pre><code>‘iterator’ is not a member of ‘std::queue&lt;std::pair&lt;int, Node*&gt; &gt;’
  queue&lt;pair&lt;int, Node*&gt;&gt;::iterator it = myQueue.front(); 
  </code></pre>
  <p>What's the correct syntax?</p>