Boost logo

Boost Users :

Subject: Re: [Boost-users] [lambda][optional] Accessing an optional variable through lambda
From: Ryan McConnehey (mccorywork_at_[hidden])
Date: 2010-08-12 03:47:50


Nathan Crookston wrote:
> To do what you'd like with Boost.Phoenix
> (#include <boost/spirit/home/phoenix.hpp> to get all of it) you could
> replace most of operator<< with the following:
>
> namespace bp = boost::phoenix;
> std::for_each(points.begin(), points.end(),
> stream << *bp::bind(&DataPoint::m_Time, bp::arg_names::_1) << " ");
>
> Much cleaner, if that option's available to you.
>
> Good luck,
>
> Nate
>
Thanks for the alternative. It does look much cleaner. I've seen boost
Phoenix around but haven't really gotten into to it. Is there a web
article that describes the pros and cons of using Phoenix versus
Lambda. From an outside perspective it looks like they do the same
things. This of course leads me to ask why there are two libraries.

Ryan


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