Title
List initializer in non-type template default argument
Status
drwp
Section
13.4.3 [temp.arg.nontype]
Submitter
Ville Voutilainen

Created on 2014-11-20.00:00:00 last changed 7 months ago

Messages

Date: 2024-02-16.23:59:08

[ Resolved by paper P2308R1 (Template parameter initialization), adopted in November, 2023. ]

According to 13.4.3 [temp.arg.nontype] paragraph 1,

A template-argument for a non-type template-parameter shall be a converted constant expression (7.7 [expr.const]) of the type of the template-parameter.

This does not permit an example like:

  template <int* x = {}> struct X {};

which seems inconsistent.

See also issues 2450 and 2459.

History
Date User Action Args
2024-04-05 21:43:46adminsetstatus: dr -> drwp
2024-02-16 23:59:08adminsetstatus: drafting -> dr
2014-11-20 00:00:00admincreate