Issue 2247: Type traits and std::nullptr_t (original) (raw)
This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++14 status.
2247. Type traits and std::nullptr_t
Section: 21.3.6.2 [meta.unary.cat] Status: C++14 Submitter: Joe Gottman Opened: 2013-03-15 Last modified: 2016-01-28
Priority: Not Prioritized
View all issues with C++14 status.
Discussion:
According to 21.3.6.2 [meta.unary.cat], for every type T, exactly one of the primary type traits is true. So which is true for the type std::nullptr_t? By 5.13.8 [lex.nullptr] std::nullptr_t is not a pointer type or a pointer-to-member type, so is_pointer, is_member_object_pointer and is_member_function_pointer can't be true for std::nullptr_t, and none of the other primary type traits seem to apply.
[2013-04-20, Bristol]
Rename to is_null_pointer, move to Ready
Previous wording:
This wording is relative to N3485.
- Edit 21.3.3 [meta.type.synop], header
<type_traits>synopsis:namespace std {
[…]
// 20.9.4.1, primary type categories:
template struct is_void;
template struct is_nullptr;
template struct is_integral;
template struct is_floating_point;
[…]
}- Edit Table 47 — "Primary type category predicates" as indicated:
Table 47 — Primary type category predicates
Template Condition Comments … template struct is_nullptr; T is std::nullptr_t ([basic.fundamental]) …
[2013-09-29, Chicago]
Apply to the Working Paper
Proposed resolution:
This wording is relative to N3485.
- Edit 21.3.3 [meta.type.synop], header
<type_traits>synopsis:namespace std {
[…]
// 20.9.4.1, primary type categories:
template struct is_void;
template struct is_null_pointer;
template struct is_integral;
template struct is_floating_point;
[…]
} - Edit Table 47 — "Primary type category predicates" as indicated:
Table 47 — Primary type category predicates
Template Condition Comments … template struct is_null_pointer; T is std::nullptr_t ([basic.fundamental]) …