move for_each implementation to for_each.hpp