What profit of universal reference usage in range based loop?

Viewed 322

Many times I saw code like this:

template<typename Collection>
void Foo(Collection&& c)
{
    for (auto&& i : std::forward<Collection>(c))
    // do something with i
}

For all STL containers (except vector<bool>) i has type of lvalue reference. Is any practical sense to type auto&& in this case?

1 Answers
Related