Boost logo

Boost :

From: John Maddock (john_maddock_at_[hidden])
Date: 2002-07-06 05:41:17


> That was a really dumb question. Of course is_empty<> works for
> bcc.

Only if the -Ve compiler option is used.

>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.

Well I know that there are different opions on this, but when I tried to
program type traits with types rather than values I ran into even more
problems than I did with values. Seriously you really can program with
values and Borland C++ provided you follow the guidelines:
www.boost.org/more/int_const_guidelines.htm

> 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.

Use ::fully::qualified::names, note the leading :: add that to your problem
code and it should work.

John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/index.htm


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