use range-based for in c++11