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
news:ag0idi$t84$1_at_main.gmane.org...
> 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
{
public:
    typedef bool2type<boost::is_empty<some_class>::value>::value value;
};

but this doesn't:

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

Any advice is appreciated.

Dave


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