Created on 2007-08-25.00:00:00 last changed 171 months ago
Proposed resolution:
In [meta.type.synop] in the group "type properties", just below the line
template <class T> struct is_pod;
add a new one:
template <class T> struct is_literal;
In [meta.unary.prop], table Type Property Predicates, just below the line for the is_pod property add a new line:
Template | Condition | Preconditions |
---|---|---|
template <class T> struct is_literal; | T is a literal type (3.9) | T shall be a complete type, an array of unknown bound, or (possibly cv-qualified) void. |
[ 2009-10 Santa Cruz: ]
NAD EditorialResolved. Solved by N2984.
[ Addressed in N2947. ]
[ 2009-07 Frankfurt: ]
Beman, Daniel, and Alisdair will work on a paper proposing new type traits.
[ Alisdair is considering preparing a paper listing a number of missing type traits, and feels that it might be useful to handle them all together rather than piecemeal. This would affect issue 719 and 750. These two issues should move to OPEN pending AM paper on type traits. ]
Since the inclusion of constexpr in the standard draft N2369 we have a new type category "literal", which is defined in [basic.types]/p.11:
-11- A type is a literal type if it is:
- a scalar type; or
a class type (clause 9) with
- a trivial copy constructor,
- a trivial destructor,
- at least one constexpr constructor other than the copy constructor,
- no virtual base classes, and
- all non-static data members and base classes of literal types; or
- an array of literal type.
I strongly suggest that the standard provides a type traits for literal types in [meta.unary.prop] for several reasons:
The special problem of reason (c) is that I don't see currently a way to portably test the condition for literal class types:
- at least one constexpr constructor other than the copy constructor,
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-11-19 19:04:45 | admin | set | status: nad editorial -> resolved |
2010-10-21 18:28:33 | admin | set | messages: + msg3537 |
2010-10-21 18:28:33 | admin | set | messages: + msg3536 |
2010-10-21 18:28:33 | admin | set | messages: + msg3535 |
2010-10-21 18:28:33 | admin | set | messages: + msg3534 |
2010-10-21 18:28:33 | admin | set | messages: + msg3533 |
2007-08-25 00:00:00 | admin | create |