Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-03-07 10:32:12


AMDG

Giovanni Piero Deretta wrote:
> It seems a perfect application for fold:
>
> template<typename Seq>
> struct or_seq
> : mpl::apply<
> mpl::fold<mpl::_1, mpl::false_, mpl::quote2<mpl::or_> >
> , Seq
> > {};
>
> template<typename Seq>
> struct and_seq
> : mpl::apply<
> mpl::fold<mpl::_1, mpl::true_, mpl::quote2<mpl::and_> >
> , Seq
> > {};
>

Not quite, because we want it to short circuit.
Not to mention that quote2 will not work on and_ and or_.

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk