С явными итераторами Я бы конвертировал это:
Код: Выделить всё
for (auto i = c.begin(); i != c.end(); ++i) { ...
Код: Выделить всё
for (auto i = c.rbegin(); i != c.rend(); ++i) { ...
Код: Выделить всё
for (auto& i: c) { ...
Код: Выделить всё
for (auto& i: std::magic_reverse_adapter(c)) { ...
Подробнее здесь: https://stackoverflow.com/questions/854 ... d-for-loop
Мобильная версия