replaces std::for_each with for()

replaces `std::for_each` with C++11 `for( : )`