Boost logo

Boost Users :

From: Eduardo Bezerra (edubez_at_[hidden])
Date: 2006-01-09 08:01:46


Hi Dave,

Re-reading this great book for the 2nd time, and studying chapter
11 I found myself trying to understand the mpl::fold algorithm.

Thanks for this wonderful work.

My best regards,
Eduardo

On 1/8/06, David Abrahams <dave_at_[hidden]> wrote:
> Eduardo Bezerra <edubez_at_[hidden]> writes:
>
> > Hi,
> >
> > I'm having a hard time trying to understand what the placeholders
> > _1 and _2 mean in the context of the mpl::fold algorithm.
> >
> >>From the Boost.Mpl Reference manual:
> >
> >
> > typedef vector<long,float,short,double,float,long,long double> types;
> >
> > typedef fold<
> > types
> > , int_<0>
> > , if_< is_float<_2>,next<_1>,_1 >
> >>::type number_of_floats;
> >
> >
> > BOOST_MPL_ASSERT_RELATION( number_of_floats::value, ==, 4 );
> >
> >
> > Could someone give me some help on this ?
>
> <shameless plug>
> http://www.boost-consulting.com/mplbook contains a good explanation.
> </shameless plug>
>
> --
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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