Boost logo

Boost :

Subject: Re: [boost] [type_traits] Big changes in develop
From: John Maddock (jz.maddock_at_[hidden])
Date: 2015-05-28 12:18:29


On 28/05/2015 16:59, Peter Dimov wrote:
>> It looks to me that following the ?: specification would actually be
>> easier to follow and more correct.
>
> I sketched an implementation along those lines, which as a side effect
> defines the following useful traits:
>
> identity<T> (::type == T)
> remove_cv_ref<T> (remove_cv<remove_reference>)

I would be inclined to call that remove_cv_reference ?

> combine_cv<T, U> (copies the cv qualifiers from U to T)

See https://svn.boost.org/trac/boost/ticket/3970

> common_arithmetic_type<T, U> (for arithmetic or enum types, their
> common type per "usual arithmetic conversions")
> composite_pointer_type<T, U> ( the "composite pointer type" per the
> standard, that is, the pointer type to which both T and U will convert)
>
> Should we add those traits to the library proper, or is it better for
> them to remain implementation details? The first three seem to be
> rediscovered on a daily basis.
>
IMO +1 on the first three, much less sure about the last 2. Care to
submit a PR?

Thanks, John.


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