title: One line std::vector ctor from mapping another vector?
body: <p>C++11</p>
  
  <p>There should be a one-line version of the last <em>two</em> lines.</p>
  
  <pre><code>        typedef std::pair&lt;T1, T2&gt; impl_node;
          std::vector&lt;impl_node&gt; impl;
          /* do stuff with impl */
          std::vector&lt;T1&gt; retval(impl.size());
          std::transform(impl.cbegin(), impl.cend(), retval.begin(),
                           [](const impl_node&amp; in) { return *in.first; });
  </code></pre>
  
  <p>I tried writing some sort of custom iterator adapter, and the types are getting hairy. What's the "right" solution? (And it probably generalizes to all sorts of other adapters.)</p>