What is the correct way of using C++11\'s range-based for?
for
What syntax should be used? for (auto elem : container), or for (auto&
for (auto elem : container)
for (auto&
The correct means is always
for(auto&& elem : container)
This will guarantee the preservation of all semantics.