1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <iostream>
#include <vector>
#include <algorithm>
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>
using namespace std;
using namespace boost::lambda;
void main()
{
vector<int> MyCollection(10);
for_each(MyCollection.begin(), MyCollection.end(), _1 = 4 );
for_each(MyCollection.begin(), MyCollection.end(), cout << _1 << '\n');
system("pause");
}
|