better c++11 for loop usage