Learning New C++ Standards - for loop simplification Technical Solution | 1 min read Usually for loop takes a counter to iterate through the elements. For that you have to initialize a counter, check whether the counter is less than the total element count, then take element from the container and use use it and increment counter.