is_literal_type
specification needs a little cleanupSection: D.14 [depr.meta.types] Status: C++17 Submitter: Tim Song Opened: 2016-12-09 Last modified: 2020-09-06
Priority: 0
View all other issues in [depr.meta.types].
View all issues with C++17 status.
Discussion:
D.14 [depr.meta.types]/3 currently reads:
Effects:
is_literal_type
has a base-characteristic oftrue_type
ifT
is a literal type ([basic.types]), and a base-characteristic offalse_type
otherwise.
First, this doesn't seem like an Effects clause. Second, this wording fails to say that is_literal_type
is an UnaryTypeTrait
, and misspells BaseCharacteristic
— which is only defined for
UnaryTypeTraits
and BinaryTypeTraits
. Third, moving this to Annex D means that the general prohibition
against specializing type traits in [meta.type.synop]/1 no longer applies, which is presumably unintended.
[2017-01-27 Telecon]
Priority 0
Proposed resolution:
This wording is relative to N4618.
Edit D.14 [depr.meta.types] as indicated:
The header
<type_traits>
has the following addition:namespace std { template <class T> struct is_literal_type; template <class T> constexpr bool is_literal_type_v = is_literal_type<T>::value; }-2- Requires:
-3-remove_all_extents_t<T>
shall be a complete type or (possibly cv-qualified)void
.Effects:is_literal_type
has a base-characteristic oftrue_type
ifT
is a literal type (3.9), and a basecharacteristic offalse_type
otherwiseis_literal_type<T>
is aUnaryTypeTrait
(21.3.2 [meta.rqmts]) with aBaseCharacteristic
oftrue_type
ifT
is a literal type (6.8 [basic.types]), andfalse_type
otherwise. -?- The behavior of a program that adds specializations foris_literal_type
oris_literal_type_v
is undefined.