|
Boost Users : |
Subject: Re: [Boost-users] Boost Phoenix & language lambdas
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2015-05-15 08:17:24
2015-05-15 12:07 GMT+02:00 Robert Jones <robertgbjones_at_[hidden]>:
> I'm sure this has been asked before, and apologies in advance to the
> programming gods of Boost.Phoenix, but has Phoenix effectively been
> replaced by language lambdas, or are there still things for which Phoenix
> is the best answer?
>
> Thx, Rob.
>
A pair of super-simple example:
boost::for_each(v, _1 = _1 * _1);
boost::for_each(v, [](auto& x) { x = x * x; });
boost::transform(v, out, _1 * _1);
boost::transform(v, out, [](auto& x) { return x * x; });
My choice for these super-simple examples: Phoenix.
And Phoenix can do so much more...
Cheers, Kris
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