Boost logo

Boost :

From: Jaakko Jarvi (jajarvi_at_[hidden])
Date: 2003-09-05 17:18:02


In our last exciting episode Aleksey Gurtovoy wrote:

> Jaakko Jarvi wrote:
> > > 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

> Assuming that the latter version is spelled 'enable_if_c', making the former
> work is as simple as

> template< typename C, ... >
> struct enable_if
> : enable_if_c<C::value, ...>
> {
> };

This is what we are using. The documentation of not_ always uses
typedef not_<f>::type and doesn't mention that it contains a member
named value. That is what got us confused.

Are the docs on www.boost.org out of date? We don't have the boostbook
toolchain up so we don't have the latest CVS version of the docs.
The tutorial seems to be using bool_c which is not documented in the
reference manual (that uses bool_ , are they the same thing or is
bool_ something different?). Also, bool_, int_, ... are not in the
categorized index.

Just ignore these if these have already been fixed in CVS.

Cheers, Jaakko & Jeremiah


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