Boost logo

Boost Users :

Subject: Re: [Boost-users] [Bind] Understanding protect
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2012-03-28 03:47:35


On Tue, Mar 27, 2012 at 8:24 PM, Thomas Heller
<thom.heller_at_[hidden]>wrote:

>
> You might also want to consider phoenix::lambda, it is like protect, but
> slightly more powerful.
> your example would then read:
> #include <boost/phoenix.hpp>
>
> int main( )
> {
> std::vector<int> v;
> v += 0,1,2,3,4,5,6;
> using boost::phoenix::bind;
> using boost::phoenix::lambda;
> using boost::phoenix::placeholders::**_1;
> using boost::phoenix::local_names::_**1;
>
> for_each( v.begin( ), v.end( ),
> bind(g, lambda(_a = _1)[bind(f, _a)]));
>
> return 0;
> }
>
>
Please don't remind me! I'd love to, but I'm stuck in the antediluvian days
of 1.37!

- Rob.



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