Boost logo

Boost :

Subject: [boost] [type_traits] Proposal: same_xxx
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2014-06-08 08:53:41


Hi,

Recently I found some use for a tool adding const to a type if some
other type is const.
My use case was something like this:

typename const_conformant
<
     Range,
typename boost::range_value<Range>::type
>::type ...

I'm guessing that such use cases are quite common, not only for const
but also other qualifiers.

Do you think that a family of traits adding or removing qualifiers based
on the qualifiers of some other type could be a useful addon to the
TypeTraits?
E.g.:

same_const<BaseT, T>
same_cv<BaseT, T>
same_pointer<BaseT, T>
same_reference<BaseT, T>
same_rvalue_reference<BaseT, T>
same_volatile<BaseT, T>
same_extents<BaseT, T>
//etc.

Regards,
Adam


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