Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2002-12-06 07:14:46


David B. Held wrote:
> > In "C++ Templates: The Complete Guide" (Recommended), they give
> > this example on pages 106-107:
> >
> > typedef char RT1;
> > typedef struct {char a[2];} RT2;
> > template<typename T> RT1 test(typename T::X const*);
> > template<typename T> RT2 test(...);
> >
> > #define type_has_member_type_X(T) \
> > (sizeof(test<T>(0) == 1)
>
> This is cool. What compilers are known to support it?

MPL's implementation ("boost/mpl/aux_/has_xxx.hpp") is known to work on
Comeau, Intel (all versions), MSVC (all versions), Metroweks 8.3/8.2 and GCC
3.2. There is no known way to make it work on Borland. You can test it
against any other compiler by trying out
"boost/libs/mpl/test/aux_/has_xxx.cpp" test case.

Aleksey


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