Title
Non-type template parameters are not variables
Status
open
Section
6.1 [basic.pre]
Submitter
Richard Smith

Created on 2025-01-09.00:00:00 last changed 2 weeks ago

Messages

Date: 2025-01-09.00:00:00

Subclause 6.1 [basic.pre] paragraph 6 specifies:

A variable is introduced by the declaration of a reference other than a non-static data member or of an object. The variable's name, if any, denotes the reference or object.

Does this mean that non-type template parameters of class type are variables? Better not.

Possible resolution:

Change in 6.1 [basic.pre] paragraph 6 as follows:

A non-template-parameter declaration is a declaration that is not a type-parameter or parameter-declaration of a template-parameter. A variable is introduced by the non-template-parameter declaration of a reference other than a non-static data member or of an object. The variable's name, if any, denotes the reference or object.
History
Date User Action Args
2025-01-09 00:00:00admincreate