Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2002-07-04 00:19:58

"David B. Held" <dheld_at_[hidden]> wrote in message
> Is there a version of boost::is_empty<> that works with bcc?

That was a really dumb question. Of course is_empty<> works for
bcc. What I really want is a set of type_traits that traffics in true_type
and false_type instead of BOOST_STATIC_CONSTANTs. This is
because bcc does not like bool template parameters much, and so
it makes it almost impossible to use the type traits in any useful
metaprogramming. It looks like a big chore to provide this
implementation, since many of the type traits depend on each other.
I was just wondering if anyone has tried to use them with bcc (for
example, in a partial spec switch), and already made any workarounds.

I wrote a wrapper called bool2type that converts an int into a true_type
or false_type, but on bcc it is very fragile, and will break if there is a
template type in the expression. For instance, this works:

template <typename T> class x
    typedef bool2type<boost::is_empty<some_class>::value>::value value;

but this doesn't:

template <typename T> class x
    typedef bool2type<boost::is_empty<T>::value>::value value;

Any advice is appreciated.


Boost list run by bdawes at, gregod at, cpdaniel at, john at