Boost logo

Boost :

From: Brock Peabody (brock.peabody_at_[hidden])
Date: 2003-09-05 15:25:55


> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
> On Behalf Of David Abrahams
> Sent: Friday, September 05, 2003 2:09 PM
> To: boost_at_[hidden]
> Subject: [boost] Re: MPL not_ etc. questions

[...]

> The other advantage to using mpl::not_<X> rather than
> mpl::not_<X>::type is that it can delay the instantiation of X when X
> is a template specialization:
>
> mpl::apply_if<
> expr1
> , mpl::not_<complicated_bool_metafunction<X> >
> , mpl::true_
> >::type z;
>
> if expr1 turns out to be mpl::false_, the complicated_metafunction
> will never be instantiated.

Am I right in betting that this would short-circuit and compile:

   typename mpl::and_<
      expr1<X>,
      expr_that_is_only_valid_if_expr1_is<X>
>::type

Where:

   mpl::bool_<
      expr1<X>::value
      && expr_that_is_only_valid_if_expr1_is<X>::value
>

Would not?

Brock


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