Boost logo

Boost :

Subject: Re: [boost] [type_traits] Big changes in develop
From: Peter Dimov (lists_at_[hidden])
Date: 2015-05-28 12:38:21

John Maddock wrote:
> > remove_cv_ref<T> (remove_cv<remove_reference>)
> I would be inclined to call that remove_cv_reference ?

remove_cv_ref is the already established name; everyone uses it. Boost has
two such, one in base_from_member, another in function_types/example.
remove_cv_ref: 3080 results in Google, remove_cv_reference: 6 results.
Although I wouldn't be surprised if we get std::remove_cv_reference at some
point, as one of those 6 results is in the LWG issue list.

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

copy_cv works too.

> > 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.

The last two appear worthy because (a) they implement things that are
specified in the standard; both "usual arithmetic conversions" and
"composite pointer type" are in [expr] and (b) they deserve their own tests,
and it's a bit odd to test implementation details. But either way is fine
with me.

> Care to submit a PR?

I'm not at the PR point yet, need to clean up the implementation and check
against the existing tests (which are pretty slim by the way) first.

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