title: Easy way to iterate through multiple std::vectors in C++
body: <p>I have two <code>std::vector</code>s of same type, and I need to iterate through both of them using the same routine. Something like this:</p>
  <pre><code>std::vector&lt;int&gt; values1, values2;
  int counter = 0;
  for (int val : values1) counter += val;
  for (int val : values2) counter += val;
  </code></pre>
  <p>Is there any simple way to write the last two lines in a single loop, to avoid code repetition? Something that would look like this:</p>
  <pre><code>std::vector&lt;int&gt; values1, values2;
  int counter = 0;
  for (int val : values1, values2) counter += val;
  </code></pre>