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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users