Title
Parentheses in address non-type template arguments
Status
c++11
Section
13.4.3 [temp.arg.nontype]
Submitter
Doug Gregor

Created on 2009-02-11.00:00:00 last changed 123 months ago

Messages

Date: 2010-08-23.00:00:00

[Voted into WP at August, 2010 meeting.]

Date: 2010-02-15.00:00:00

Proposed resolution (February, 2010):

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

  • the address of an object or function with external linkage, including function templates and function template-ids but excluding non-static class members, expressed (ignoring parentheses) as & id-expression, except that where the & is optional may be omitted if the name refers to a function or array, or and shall be omitted if the corresponding template-parameter is a reference; or

[Drafting note: The change requiring the omission of the & in the reference case fixes an existing problem that is not related to this issue.]

Date: 2009-03-15.00:00:00

Notes from the March, 2009 meeting:

The consensus of the CWG was that the parentheses should be allowed.

Date: 2009-02-11.00:00:00

According to 13.4.3 [temp.arg.nontype] paragraph 1, bullet 3, one of the acceptable forms of a non-type, non-template template argument is:

the address of an object or function... expressed as & id-expression where the & is optional if the name refers to a function or array, or if the corresponding template-parameter is a reference

It is not clear from this whether a template argument like (&i) satisfies the requirement or not.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetstatus: wp -> fdis
2010-11-29 00:00:00adminsetstatus: dr -> wp
2010-08-23 00:00:00adminsetmessages: + msg2923
2010-08-23 00:00:00adminsetstatus: ready -> dr
2010-03-29 00:00:00adminsetstatus: review -> ready
2010-02-16 00:00:00adminsetmessages: + msg2555
2010-02-16 00:00:00adminsetstatus: drafting -> review
2009-03-23 00:00:00adminsetmessages: + msg1957
2009-02-11 00:00:00admincreate