On 6/5/2015 5:42 AM, Peter Dimov wrote:
Eric Niebler wrote:
(This implements the specification in the latest C++17 draft.)
I'm not so sure. If a user defines a specialization for common_type
, it won't get used when computing common_type . As it turns out, users are not allowed to specialize common_type, which is why the C++17 specification does not concern itself with such specializations.
It's in Table 57 - Other transformations, where common_type is described:
template
struct common_type; The member typedef type shall be defined as set out below. All types in the parameter pack T shall be complete or (possibly cv) void. A program may specialize this trait if at least one template parameter in the specialization is a user-defined type. [ Note: Such specializations are needed when only explicit conversions are desired among the template arguments. --end note ]
As a curiosity, decaying the arguments before the conditional operator is also subtly wrong.
Hrm, interesting. I think there's a library issue about that. -- Eric Niebler Boost.org http://www.boost.org