Call for_each with boost::lambda library

Hi, I am trying to Call for_each with boost::lambda library to print out the return value of a function: vector<A> aList; for_each(aList.begin(), aList.end(), cout << bind(&A::getPriority, _1) ); This can't compile. can yo please tell me what did I do wrong? __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

On 3/8/06, yinglcs2@yahoo.com
Hi,
I am trying to Call for_each with boost::lambda library to print out the return value of a function:
vector<A> aList;
for_each(aList.begin(), aList.end(), cout << bind(&A::getPriority, _1) );
This can't compile. can yo please tell me what did I do wrong?
Without more detail (e.g. error message, what does A look like...),
it's difficult to tell....
Here's a minimal example that *does* compile - where is your code different...
#include <vector>
#include <iostream>
#include <algorithm>
#include
participants (2)
-
Stuart Dootson
-
yinglcs2@yahoo.com