Wouldn't one want to use 'f(std::forward(x))' with 'auto&&' ?
So I don't think you'd want to forward it. Note that you also need the element's type to forward it, which isn't possible in general with the example's signature.
void somefunction(int && i) // i is an rvalue reference
template<typename T> void somefunction2(T && i) // i is a universal reference
It might be a similar thing with auto&&. So I would tentatively agree that std::forward should be used.
- if you put in an rvalue reference, it's like std::move
- if you put in anything else, it does nothing.
So my point about the article's formulation ("when you want to modify elements in the range in generic code") and its example remains.