Iterate a vector in C++
<p>I have a vector:</p>

<pre><code>std::vector&lt;std::pair&lt;int, long&gt; &gt; v;
v.push_back(std::make_pair(1, 2L));
etc...
</code></pre>

<p>How can I iterate through it and get out the int and the long elements from it?</p>
