This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++20 status.

2940. result_of specification also needs a little cleanup

Section: D.19 [depr.meta.types] Status: C++20 Submitter: Daniel Krügler Opened: 2017-03-04 Last modified: 2021-02-25

Priority: 3

View all other issues in [depr.meta.types].

View all issues with C++20 status.

Discussion:

P0604R0 missed a similar adjustment that was performed for the deprecated type trait templates is_literal_type and is_literal_type_v via LWG 2838:

Moving the result_of to Annex D means that the general prohibition against specializing type traits in [meta.type.synop]/1 does no longer exist, so should be explicitly spelled out. Wording will be provided after publication of the successor of N4640.

[2017-03-04, Kona]

Set priority to 3

[2017-04-24, Daniel provides wording]

Instead of enumerating all the templates where adding a specialization is valid, a general exclusion rule is provided. Albeit currently not needed for the templates handled by this sub-clause, a potential exception case is constructed to ensure correctness for the first deprecated trait template that would permit specializations by the user.

[2017-06-10, Moved to Tentatively Ready after 6 positive votes on c++std-lib]

Proposed resolution:

This wording is relative to N4659.

  1. Change D.19 [depr.meta.types] as indicated:

    -4- The behavior of a program that adds specializations for any of the templates defined in this subclause is_literal_type or is_literal_type_v is undefined, unless explicitly permitted by the specification of the corresponding template.