Boost logo

Boost :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2003-10-27 10:39:22


[2003-10-27] Brian McNamara wrote:

>On Mon, Oct 27, 2003 at 07:33:16AM -0700, Dave Gomboc wrote:
>> > 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.)
>
>I can definitely imagine this. I was thinking the same thing and was
>going to cite the 'argument order clarity' as one of the advantages to
>is_base_and_derived, until I had the epiphany that
>
> is_subtype< D, B >
>
>is just how C++ forces us to spell
>
> D::is_subtype<B>
>
>non-intrusively.
>
>
>Oh, which means I actually prefer the name "is_subtype_of".
>
>
>It's totally analogous to the non-meta case, e.g.
>
> contains( aRegion, aPoint )
>
>means
>
> aRegion.contains( aPoint )

Doesn't that then argue for something like:

    is_<D>::subtype_of<B>

??

-- grafik - Don't Assume Anything
-- rrivera (at) acm.org - grafik (at) redshift-software.com
-- 102708583 (at) icq


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