Suppose we have those two functions:
std::string foo()
{
return "myString";
}
and
std::string goo()
{
return std::string("myString");
}
I am thinking that in foo
the string will be constructed, then copied and then returned while in the second it will be constructed and moved.
Am I correct? Or both cases are the same?