title: Creating a new vector using a transform
body: <p>I have a vector of integers and I want to convert it to a vector of pairs (pair consists of a bool and a int). My current code is simple like this:</p>
  
  <pre><code>    std::vector&lt;int&gt; a;
      std::vector&lt;std::pair&lt;bool,int&gt; &gt; b;
  
      a.push_back(1);
      a.push_back(2);
      a.push_back(3);
  
      for(int i = 0; i &lt; a.size(); ++i)
      {
          b.push_back(std::make_pair(false, a[i]));
      }
  </code></pre>
  
  <p>Is there any way to do this without writing the loop myself? Probably using some algorithms?</p>