#include <iostream>
#include <list>
#include <algorithm>
int
main(int argc, char* argv[])
{
using namespace std;
list<int> someList = {1, 2, 3, 4, 5};
int total = 0;
std::for_each(someList.begin(), someList.end(), [&total](int x){ total += x; });
cout << total << endl;
return 0;
}