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.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at