Returning std::move(f) in std::for_each
I'm writing an implementation of standard c++ library for study.
The C++11 standard says that for_each returns std::move(f).
template <class InputIterator, class Function>
Function for_each(InputIterator first, InputIterator last, Function f);
Returns: std::move(f).
I thought that function scope local variable is move-constructed when it's
returned. Should I return move(f) explicitly?
No comments:
Post a Comment