Boost logo

Boost Users :

From: jarvi (jarvi_at_[hidden])
Date: 2005-09-26 10:40:35


the var function makes a lambda functor out of a variable, so you can
write the expression as:

var(n) = _1

Best, Jaakko

On Sep 26, 2005, at 9:13 AM, Alexander Borghgraef wrote:

> Hi all,
>
>  I have been trying out boost::lambda for the first time, and I did
> encounter something which I can't seem to solve.
> Simplified, what I'd like to do amounts to this:
>
> list<int> intlist;  // fill up list someway
> int n;
> for_each( intlist.begin(),
>                intlist.end(),
>                n = _1
>              );
>
>  Obviously, this fails because it implies a cast from placeholder to
> int, which isn't defined. Is there some way to do
> this using lambda?
>
> --
> Alex Borghgraef_______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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