Relative Content

Tag Archive for c++c++11move-semanticsreturn-value-optimization

C++ move semantics on returned value

In term of move semantics on return value, I heard that the best practice is to return the object as is, and don’t call std::move to it, as it prevent return value optimizations. However, consider the following code.