In C++ what is the best way to return a function local std::string variable from the function?
std::string MyFunc() { std::string mystring(\"test\"); ret
No. That is not true. Even if mystring has gone out of scope and is destroyed, ret has a copy of mystring as the function MyFunc returns by value.
mystring
ret
MyFunc