What is the correct way of using C++11’s range-based for
?
What syntax should be used? for (auto elem : container)
,
or for (auto& elem : container)
or for (const auto& elem : container)
?
Or some other?
What is the correct way of using C++11’s range-based for
?
What syntax should be used? for (auto elem : container)
,
or for (auto& elem : container)
or for (const auto& elem : container)
?
Or some other?