Title
Templates and static data members
Status
drafting
Section
Clause [13] [temp]
Submitter
Mike Miller

Created on 2000-02-11.00:00:00 last changed 267 months ago

Messages

Date: 2002-04-15.00:00:00

Notes from the 4/02 meeting:

Daveed Vandevoorde will propose appropriate terminology.

Date: 2020-12-15.00:00:00

Static data members of template classes and of nested classes of template classes are not themselves templates but receive much the same treatment as template. For instance, Clause 13 [temp] paragraph 1 says that templates are only "classes or functions" but implies that "a static data member of a class template or of a class nested within a class template" is defined using the template-declaration syntax.

There are many places in the clause, however, where static data members of one sort or another are overlooked. For instance, Clause 13 [temp] paragraph 6 allows static data members of class templates to be declared with the export keyword. I would expect that static data members of (non-template) classes nested within class templates could also be exported, but they are not mentioned here.

Paragraph 8, however, overlooks static data members altogether and deals only with "templates" in defining the effect of the export keyword; there is no description of the semantics of defining a static data member of a template to be exported.

These are just two instances of a systematic problem. The entire clause needs to be examined to determine which statements about "templates" apply to static data members, and which statements about "static data members of class templates" also apply to static data members of non-template classes nested within class templates.

(The question also applies to member functions of template classes; see issue 217, where the phrase "non-template function" in 9.3.4.7 [dcl.fct.default] paragraph 4 is apparently intended not to include non-template member functions of template classes. See also issue 108, which would benefit from understanding nested classes of class templates as templates. Also, see issue 249, in which the usage of the phrase "member function template" is questioned.)

History
Date User Action Args
2002-05-10 00:00:00adminsetmessages: + msg642
2002-05-10 00:00:00adminsetstatus: open -> drafting
2000-02-11 00:00:00admincreate