replaces std::for_each with for()

replaces `std::for_each` with C++11 `for( : )`
Merge pull request #4565 from ricardoquesada/std_for_each_gone

replaces std::for_each with for()