title: Vector of pairs or pair of vectors?
body: <p>In my code I'm dealing with a set of measurements (a vector of float), in which each element has two associated uncertainties (say +up/-down).
  Let's say I want to dump on screen these values, something like</p>
  
  <pre><code>Loop over the vector of the measurements
  {
     cout &lt;&lt; i-th central value &lt;&lt; " +" &lt;&lt; i-th up uncertainty &lt;&lt; " / -" &lt;&lt; i-th down uncertainty &lt;&lt; end; 
  }
  </code></pre>
  
  <p>What's the most efficient/elegant way to do it?</p>
  
  <p>1) Using a pair of vectors</p>
  
  <pre><code>vector&lt;float&gt; central; //central measurement
  pair&lt;vector&lt;float&gt;, vector&lt;float&gt;&gt; errors; //errors
  for( int i = 0; i &lt; central.size ; i++ )
  {
      cout &lt;&lt; central.at(i) &lt;&lt; " +" &lt;&lt; errors.first.at(i) &lt;&lt; " / -" &lt;&lt; errors.second.at(i) &lt;&lt; endl;
  }
  </code></pre>
  
  <p>2) Using a vector of pairs:</p>
  
  <pre><code>vector&lt;float&gt; central; //central measurement
  vector&lt;pair&lt;float,float&gt;&gt; errors; //errors
  for( int i = 0; i &lt; central.size ; i++ )
  {
      cout &lt;&lt; central.at(i) &lt;&lt; " +" &lt;&lt; errors.at(i).first &lt;&lt; " / -" &lt;&lt; errors.at(i).second &lt;&lt; endl;
  }
  </code></pre>
  
  <p>3) Two separate vectors:</p>
  
  <pre><code>vector&lt;float&gt; central; //central measurement
  vector&lt;float&gt; errUp; //errors up
  vector&lt;float&gt; errDown; //errors down
  for( int i = 0; i &lt; central.size ; i++ )
  {
      cout &lt;&lt; central.at(i) &lt;&lt; " +" &lt;&lt; errUp.at(i) &lt;&lt; " / -" &lt;&lt; errDown.at(i) &lt;&lt; endl;
  }
  </code></pre>