I came across this example from Accelerated C++
vector<string> func(const string&); //function declaration
vector<string> 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
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?