|
Boost : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-02-04 07:47:52
Joel de Guzman wrote:
> Hi,
>
> Borland cannot handle this code:
>
> #include <boost/type_traits.hpp>
> #include <boost/mpl/if.hpp>
>
> using namespace boost;
> using namespace boost::mpl;
>
> struct A {};
> struct B {};
>
> template <typename T>
> struct C : if_<is_empty<T>, A, B>::type {};
>
> struct D { int i; };
> struct E {};
>
> struct F : C<D> {};
> struct G : C<E> {};
Just tried. Works pretty fine. My CVS tree might be a week old, or so.
Also, maybe 'if_c<::boost::is_empty<T>::value, A, B>' will work. Did
the same with 'is_same' recently.
HTH,
Volodya
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk