Why is the copy constructor called on a function argument when the argument is passed by reference?
<p>I came across this example from Accelerated C++</p>

<pre><code>vector&lt;string&gt; func(const string&amp;); //function declaration

vector&lt;string&gt; v;
string line = "abc";

v = func(line); //on entry, initialization of func's single parameter from line
         //on exit, both initialization of the return value and then assignment to v
</code></pre>

<p>My question is, since func takes a const string reference as a parameter, why is the copy constructor invoked when entering func? Since line is being passed by reference doesn't func just keep a reference to line on its local stack?</p>
