I was learning the history about Lambda's in C++ and saw the following code (which is not lambda) but I am surprised how it Works
struct Printer{
void operator() (int x) const{
std::cout << x << '\n';
}
};
int main(){
std::vector <int> vint;
//doing it the C++ 03 way
vint.push_back(1);
vint.push_back(7);
std::for_each(vint.begin(),vint.end(), Printer());
}
How is the Printer() call in the for_each function working?