Boost logo

Boost Users :

From: Mattias Brndstrm (thebrasse_at_[hidden])
Date: 2004-07-28 09:19:21


I am new to the boost lambda library so this might be a naive question.
Here goes. This is what I want to do:

class Foo {
   int bar() { return 42; }

int main()
   std::vector<Foo> v;

   count_if(v.begin(), v.end(), boost::bind(&Foo::bar, _1) == 42);

   return 0;

However, I get a comilation error when trying to compile this with g++
version 3.3.2:

test.cpp: In function `int main()':
test.cpp:17: error: no match for 'operator==' in '`empty_class_expr' not
test.cpp:17: sorry, unimplemented: supported by dump_expr
test.cpp:17: sorry, unimplemented: boost::bind(R (T::*)(), A1) [with R =
int, T = Foo, A1 = boost::arg<1>]((<unnamed>::_1, <expression error>))
== 42'

To me it seems that this is something that I should be able to do with
the BLL. If someone could point me in the right direction here I would
be really greatful!

Thanks in advance!


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at