std for_each code example
Example: for_each c++
for_each( InputIt first, InputIt last, UnaryFunction f );
//Example
vector<int> v{ 1, 2, 3, 4, 5 };
for_each(v.begin(), v.end(), [](int i) { cout<<i<<" "<<endl; });
for_each( InputIt first, InputIt last, UnaryFunction f );
//Example
vector<int> v{ 1, 2, 3, 4, 5 };
for_each(v.begin(), v.end(), [](int i) { cout<<i<<" "<<endl; });