Title
is_literal_type specification needs a little cleanup
Status
c++17
Section
[depr.meta.types]
Submitter
Tim Song

Created on 2016-12-09.00:00:00 last changed 82 months ago

Messages

Date: 2017-01-30.15:17:53

Proposed resolution:

This wording is relative to N4618.

  1. Edit [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: remove_all_extents_t<T> shall be a complete type or (possibly cv-qualified) void.

    -3- Effects: is_literal_type has a base-characteristic of true_type if T is a literal type (3.9), and a basecharacteristic of false_type otherwiseis_literal_type<T> is a UnaryTypeTrait ([meta.rqmts]) with a BaseCharacteristic of true_type if T is a literal type ([basic.types]), and false_type otherwise.

    -?- The behavior of a program that adds specializations for is_literal_type or is_literal_type_v is undefined.

Date: 2017-01-27.00:00:00

[ 2017-01-27 Telecon ]

Priority 0

Date: 2016-12-19.13:38:24

[depr.meta.types]/3 currently reads:

Effects: is_literal_type has a base-characteristic of true_type if T is a literal type ([basic.types]), and a base-characteristic of false_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.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2017-03-05 23:41:16adminsetstatus: ready -> wp
2017-01-30 15:17:53adminsetmessages: + msg8813
2017-01-30 15:17:53adminsetstatus: new -> ready
2016-12-18 11:32:33adminsetmessages: + msg8759
2016-12-09 00:00:00admincreate