R
Rafal Dabrowa
Suppose I have the following structure:
struct xy { int x, y; };
and the following vector:
vector<xy> v(10);
I want to use boost/lambda for find an item in the table.
Let's say, with x member value equal to 10. I wrote
something like this:
vector<xy>::iterator pos = find_if(v.begin(), v.end(), _1.x == 10);
but this doesn't work. Compiler complains that 'const struct
boost::lambda::lambda_functor<boost::lambda:laceholder<1> >' has no
member named 'x'.
How the above code should look correctly ?
Rafal
struct xy { int x, y; };
and the following vector:
vector<xy> v(10);
I want to use boost/lambda for find an item in the table.
Let's say, with x member value equal to 10. I wrote
something like this:
vector<xy>::iterator pos = find_if(v.begin(), v.end(), _1.x == 10);
but this doesn't work. Compiler complains that 'const struct
boost::lambda::lambda_functor<boost::lambda:laceholder<1> >' has no
member named 'x'.
How the above code should look correctly ?
Rafal