Boost logo

Boost :

Subject: Re: [boost] [type_traits] Big changes in develop
From: Peter Dimov (lists_at_[hidden])
Date: 2015-05-28 11:59:30

> 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>)
combine_cv<T, U> (copies the cv qualifiers from U to T)
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.

Boost list run by bdawes at, gregod at, cpdaniel at, john at