Boost logo

Boost :

From: Jaakko Jarvi (jajarvi_at_[hidden])
Date: 2003-09-05 14:57:11


In our last exciting episode "Brock Peabody" wrote:
> Importance: Normal

> > We're writing enable_if docs and have a question about MPL. The docs
> > do not seem to mention metafunctions like not_ or and_; we can find
> > logical_not, logical_and, etc. which seem to be applying to functions,
> > not values.
>
> > So assuming we have:
>
> > class A { static const bool value = true; };
>
> > What is the right way to get the inverse of A::value as an MPL wrapped
> > boolean?
>
> > Is it boost::mpl::not_<A> or something else?

> How about:

> boost::mpl::bool_<!A::value>

> ?

No, we do not want to unwrap A (by A::value), then rewrap the result
using bool_.
This came up with enable_if where many boosters wanted to be able to
say something like:

enable_if<mpl::not_<is_integral<T> >, ...>::type instead of
enable_if<!is_integral<T>::value, ...>::type

Now we just want to know whether not_ is part of MPL's public interface.

  Jaakko & Jeremiah


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