std::for_each( myList.begin(), myList.end(),
(
std::cout << "value: " << _1 << "\n",
std::cout << "interval: " << var( interval ) << "\n",
var( interval )++
));
}
I understood that writing a lambda expression would be a substitute
for writing a functor.
I expected the following result
value: 100
interval: 20
value: 200
interval: 21