Section: 23.15.4.3 [meta.unary.prop] Status: C++14 Submitter: Daniel Krügler Opened: 20121007 Last modified: 20160210
Priority: Not Prioritized
View other active issues in [meta.unary.prop].
View all other issues in [meta.unary.prop].
View all issues with C++14 status.
Discussion:
The preconditions for the trait is_signed allow for any types as template arguments, including nonarithmetic ones.
But the current wording in Table 49 defining the predicate condition,
is_arithmetic<T>::value && T(1) < T(0)
looks like real code and so leaves it open whether such argument types would create a wellformed instantiation of the trait template or not. As written this definition would lead to a hard instantiation error for a nonarithmetic type like e.g.
struct S {};
I would suggest that the wording clarifies that the instantiation would be valid for such types as well, by means of a specification that is not an exact code pattern. This also reflects how existing implementations behave.
[20130315 Issues Teleconference]
Moved to Tentatively Ready.
[20130420 Bristol]
Proposed resolution:
This wording is relative to N3376.
Change Table 49 as indicated:
Template  Condition  Preconditions 

template <class T> struct is_signed; 
If is_arithmetic<T>::value integral_constant<bool, T(1) < T(0)>::value; otherwise, false. 

template <class T> struct is_unsigned; 
If is_arithmetic<T>::value integral_constant<bool, T(0) < T(1)>::value; otherwise, false. 