|
Boost Users : |
From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2006-02-01 07:07:49
Daniel Lidström wrote:
> 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?
>Thanks in advance!
>
>
Yes, but you need binding syntax:
typedef list< list< int > > lli;
for_each(ll.begin(), ll.end(), var(count) += bind(&lli::size, _1));
Sebastian Redl
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net