title: Returning an object vs returning by reference an object
body: <p>Is there any difference between</p>
  
  <pre><code>vector&lt;int&gt; function(vector&lt;int&gt;&amp; input) {
      // do something with input then return it
      input.push_back(3);
      return input;
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>vector&lt;int&gt;&amp; function(vector&lt;int&gt;&amp; input) {
      // do something with input then return it
      input.push_back(3);
      return input;
  }
  </code></pre>
  
  <p>Does it matter? Since when you assign the return of the function to a new variable, the vector gets copied anyways:</p>
  
  <pre><code>vector&lt;int&gt;result = function(some_vector);
  </code></pre>