#include #include #include using namespace std; void printnumber(int y) { cout << y << endl; } struct PrintNumStruct { void operator() (int y) { cout << y << endl; } } printnumberobject; int main() { vector numbers { 1, 2, 3, 4, 5, 10, 15, 20, 25, 35, 45, 50 }; for_each(numbers.begin(), numbers.end(), [](int y) -> void { cout << y << endl; }); }