Boost logo

Boost :

From: Gennadiy E. Rozental (rogeeff_at_[hidden])
Date: 2001-11-19 20:06:52


--- In boost_at_y..., "Andrei Alexandrescu" <andrewalex_at_h...> wrote:
> 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)
>

Why don't to implement this using boost::is_convertable and
boost::same_type?

Gennadiy.

> 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