Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-01-29 07:06:00


From: "Rani Sharoni" <rani_sharoni_at_[hidden]>
>
> I fogot to show little usability sample:
>
> struct B {};
> struct B1 : B {};
> struct B2 : B {};
> struct D : B1, private B2 {};
>
> typedef char Test[is_base_and_derived<B, D>::result]; // improvement 1 -
> multiple base
> typedef char Test[is_base_and_derived<B1,D>::result];
> typedef char Test[is_base_and_derived<B2,D>::result]; // improvement 2 -
> private base
> typedef char Test[!is_base_and_derived<int,D>::result];

Very clever. But I'm not sure whether this is what is_base_and_derived is
supposed to check. It seems that many are using it as
is_accessible_base_of_derived, is-a, or is_convertible<D*, B*>.

Perhaps we need two separate metafunctions for that.


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