the std::move of returned objects can prevent copy elision hence should be avoided. While unique_ptr does not have lvalues copy c-tor the return value from function is an rvalue so the move c-tor can be used.
- is duplicated by
-
SERVER-23727 pessimizing moves
- Closed