Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2001-11-19 19:51:17


Thanks for all the info. Quick answer below.

> Maybe you'd better explain SUPERSUBCLASS to those of us that don't know.

////////////////////////////////////////////////////////////////////////////
////
// macro SUPERSUBCLASS
// Invocation: SUPERSUBCLASS(B, D) where B and D are types.
// Returns true if B is a public base of D, or if B and D are aliases of the
// same type.
//
// Caveat: might not work if T and U are in a private inheritance hierarchy.
////////////////////////////////////////////////////////////////////////////
////

#define SUPERSUBCLASS(T, U) \
    (::Loki::Conversion<const U*, const T*>::exists && \
    !::Loki::Conversion<const T*, const void*>::sameType)

Now I also notice there's a bug: I should qualify the types with volatile as
well. Volatile hits again :o).

Cheers,

Andrei


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