for_each
As the name suggests, this method picks up each value in our container and performs the desired action.
std::for_each
applies a unary callable to each element of its range. The range is given by the input iterators.
Get hands-on with 1400+ tech skills courses.