title: Proper way (move semantics) to return a std::vector from function calling in C++11
body: <p>I want to fill std::vector (or some other STL container):</p>
  
  <pre><code>class Foo {
  public:
    Foo(int _n, const Bar &amp;_m);
  private:
    std::vector&lt;Foo&gt; fooes_;
  }
  </code></pre>
  
  <p><em>1.Good looking ctor, expensive performance</em></p>
  
  <pre><code>std::vector&lt;Foo&gt; get_vector(int _n, const Bar &amp;_m) {
    std::vector&lt;Foo&gt; ret;
    ... // filling ret depending from arguments
    return ret;
  }
  
  Foo::Foo(int _n, const Bar &amp;_m) : fooes_(get_vector(_n, _m) {}
  </code></pre>
  
  <p><em>2. Better performance, worse looking ctor</em></p>
  
  <pre><code>void fill_vector(int _n, const Bar &amp;_m, std::vector&lt;Foo&gt; &amp;_ret) {
    ... // filling ret depending from arguments
  }
  
  Foo::Foo(int _n, const Bar &amp;_m) { fill_vector(_n, _m, fooes_); }
  </code></pre>
  
  <p>Is it possible to rewrite <code>get_vector</code> function from 1st example with C++0x (move semantics features and so on) to avoid redundant copying and constructor calls?</p>