Boost logo

Boost :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2006-05-05 15:00:06


David Abrahams wrote:
> "John Maddock" <john_at_[hidden]> writes:
>
> Most of the type traits are designed to do something legal and
> reasonable even when doing the right thing is impossible, e.g.
>
> remove_pointer<shared_ptr<T> >::type
>
> is designed to be shared_ptr<T>. If rank does somthing similar, like
> return zero when not passed a true array, then specializing it could
> break libraries.
> Besides which, it's just conceptually wrong ;-)

I actually agree with this.

>
>> So.... why not create your own traits class, call it rank if you
>> want, place it in your projects own namespace, and have the primary
>> template inherit from boost::rank. Does that make sense?
>
> That sounds sensible.
>

will do that. Since type_traits is in TR1 and thus has a lot of
visibility, I prefer to be close to the terminology used in the
type-traits when rolling my own traits because this will be more
intuitive for the users. So that's why I first thought about extending
the type_traits::rank, but since I have to agree with Dave, now will go
for solution John proposed.

thanks,

toon


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