Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-07-13 20:56:54

"David Abrahams" <dave_at_[hidden]> wrote in message
> "Jonathan Turkanis" <technews_at_[hidden]> writes:

> >
> > I wouldn't count on any member detection with VC6. I little works
> > V7.0.
> You can detect type members on vc6. See mpl/aux_/has_xxx.hpp.

I'm familiar with the implementation of has_xxx, but I was pretty sure
it didn't work on VC6


In fact, the test program at the end of this message compiles fine on
VC6, but should static assert if has_xxx is supported. Am I doing
something wrong?

By the way, I have an implementation of has_template_xxx, which
detects member templates. It works on all my SFINAE-capable
compilers -- seven, at last count -- but I'm afraid it's probably not
standard-conforming. Any interest?



    #include <boost/mpl/aux_/has_xxx.hpp>
    #include <boost/static_assert.hpp>

    struct S { };

    struct T {
        typedef int kids;

    BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_kids, kids, true)

    int main()
        BOOST_STATIC_ASSERT(has_kids<S>::value); // Should fail.

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