Boost logo

Boost :

Subject: Re: [boost] ice_and/or vs. mpl::and_/or_
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-05-14 12:36:41


On Mon, May 14, 2012 at 8:47 AM, Nathan Ridge <zeratul976_at_[hidden]>wrote:

>
> > > Is there any difference between boost::type_traits::ice_and (ice_or)
> > > and boost::mpl::and_ (or_)?
> >
> > boost::type_traits::ice_and takes bools, boost::mpl::and_ takes types.
>
> Sure. But you can always call ::value on the type to get a bool, or
> wrap the bool in mpl::bool_<> to get a type.
>
> Does it really make sense to have two facilities that basically do
> the same thing?
>

mpl::and_/or_ are convenient when you want/need laziness.

I'd imagine you'd use ice_and/or in preference to wrapping bools with
mpl::bool_ if you wanted less verbosity (and in preference to just using
the standard C++ operators &&/|| if you wanted more portability?).

- Jeff


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