This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


823. Literal types with constexpr conversions as non-type template arguments

Section: 13.4.3  [temp.arg.nontype]     Status: CD2     Submitter: FR     Date: 3 March, 2009

N2800 comment FR 29

[Voted into WP at March, 2010 meeting.]

7.7 [expr.const] permits literal types with a constexpr conversion function to an integral type to be used in an integral constant expression. However, such conversions are not listed in 13.4.3 [temp.arg.nontype] bullet 5.1 among the conversions applied to template-arguments for a non-type template-parameter of integral or enumeration type.

Notes from the March, 2009 meeting:

The original national body comment suggested allowing any literal type as a non-type template argument. The CWG was not in favor of this change, but in the course of discussing the suggestion discovered the problem with template-parameters of integral and enumeration type.

Proposed resolution (October, 2009):

Change 13.4.3 [temp.arg.nontype] bullet 1.1 as follows: