title: Iterating over pair elements in a container of pairs (C++)
body: <p>If I have a container (<code>vector</code>, <code>list</code>, etc) where each element is a <code>std::pair</code>, is there an easy way to iterate over each element of each pair?</p>
  
  <p>i.e. </p>
  
  <pre><code>std::vector&lt;std::pair&lt;int,int&gt; &gt; a;
  a.push_back(std::pair(1,3));
  a.push_back(std::pair(2,3));
  a.push_back(std::pair(4,2));
  a.push_back(std::pair(5,2));
  a.push_back(std::pair(1,5));
  </code></pre>
  
  <p>and then being able to iterate over the value: 1,3,2,3,4,2,5,2,1,5?</p>
  
  <p>Similarly, what type of functor/function would return to me a container (of the same type) with a flat listing of the pair elements as above?</p>