title: Are the days of passing const std::string & as a parameter over?
body: <p>I heard a recent talk by Herb Sutter who suggested that the reasons to pass <code>std::vector</code> and <code>std::string</code> by <code>const &amp;</code> are largely gone.  He suggested that writing a function such as the following is now preferable:</p>
  
  <pre><code>std::string do_something ( std::string inval )
  {
     std::string return_val;
     // ... do stuff ...
     return return_val;
  }
  </code></pre>
  
  <p>I understand that the <code>return_val</code> will be an rvalue at the point the function returns and can therefore be returned using move semantics, which are very cheap.  However, <code>inval</code> is still much larger than the size of a reference (which is usually implemented as a pointer).  This is because a <code>std::string</code> has various components including a pointer into the heap and a member <code>char[]</code> for short string optimization.  So it seems to me that passing by reference is still a good idea.</p>
  
  <p>Can anyone explain why Herb might have said this?</p>