Convert std::for_each to C++11 loops.