Feedback

C++ - Lambda expressions

Veröffentlicht von am 6/5/2008
(1 Bewertungen)
Zeigt ein sehr einfaches Beispiel der verwendung der Boost Lambda Library

Mehr Informationen:
- http://www.research.att.com/~bs/N1968-lambda-expressions.pdf
- http://www.boost.org
#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");
}
Abgelegt unter Lambda, Boost.

Kommentare zum Snippet

 

Logge dich ein, um hier zu kommentieren!