is there any specific case where pass-by-value is preferred over pass-by-const-reference in C++?
<p>I read that they are conceptually equal. In practice, is there any occasion that </p>

<pre><code>foo(T t)
</code></pre>

<p>is preferred over </p>

<pre><code>foo(const T&amp; t)
</code></pre>

<p>? and why?</p>

<p><hr /></p>

<p>Thanks for the answers so far, please note I am not asking the difference between by-ref and by-val.</p>

<p>Actually I was interested in the difference between <strong>by-const-ref</strong> and <strong>by-val</strong>. </p>

<p>I used to hold the oipinion that by-const-ref can replace by-value in call cases since even Herb Sutter and Bjarne said they are conceptually equal, and "by ref"(be it const) implies being faster. until recently, I read somewhere that by-val may be better optimized in some cases.</p>

<p>Then when and how? </p>
