Consider a function that takes an object by value, performs some operations on it and return that object, for example:
std::string MyToUpper (std::string s){ std::transform(s.begin(), s.end(), s.begin(), std::toupper); return s;}
Now you call this function with a temporary:
std::string Myupperstring = MyToUpper("text");
Conceptually there is no copy needed. Are modern Compilers able to elide all copies in this case? If not, are there only moves? What about this case:
std::string Mylowerstring("text");std::string Myupperstring = MyToUpper(std::move(Mylowerstring));