
1 Feb
2006
1 Feb
'06
1:30 p.m.
Thorsten Ottosen wrote:
Daniel Lidström wrote:
int main() { int count = 0; list
ll; for_each(ll.begin(), ll.end(), var(count)+=(_1).size()); }
This will not compile: (13): error C2039: 'size': is not a member of 'boost::lambda::lambda_functor<T>' Is this possible to do?
AFAICT, no. Not unless the type of _1 implements all possible member functions in the world :-)
for_each( ll.begin(), ll.end(), count += bind( &list<int>::size, _1 ) ); works for me.