Boost logo

Boost :

From: Dave Gomboc (dave_at_[hidden])
Date: 2003-10-27 09:33:16


> > currently defined. I think we should either change the
> > semantics back (possibly changing the name to something
> > more appropriate if people are more comfortable with that)
> > or simply remove is_base_and_derived, unless someone can
> > come up with a compelling case for keeping it.
>
> How about
>
> is_proper_supertype< B, D > // like current is_base_and_derived
> is_supertype< B, D > // as above, but also true if B==D
>
> IMO those names cleanly capture the relevent abstractions,
> and is_supertype (which you're arguing is the commoner case,
> and I agree) can be implemented more efficiently than
> is_base_and_derived.
>
> Actually I'd prefer
>
> is_proper_subtype< D, B >
> is_subtype< D, B >
>
> but you have to be careful that you reverse the argument
> order when changing your old code over from is_base_and_derived.

Many different forms specifying one but not the other (ancestor,
descendent, superclass, subclass, etc.) were rejected due to the ease
with which a developer could nonetheless misinterpret which argument is
supposed to go first. (You could trawl the archives for this.)

However, I see nothing wrong with

is_base_and_derived
is_proper_base_and_derived

Okay, I do see something wrong, they should start with "are". But
that's also something that was hashed out a long time ago! :-)

Dave


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