The code extract you posted is a C++11 range-based for loop. The C++ standard is now officially C++17 with work being done to finalize what is expected to become C++20.
C++11 is "old code" now.
Do you want coding that is compatible with C++03? C++98? Earlier?