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


1819. Acceptable scopes for definition of partial specialization

Section: 13.7.6.1  [temp.spec.partial.general]     Status: CD4     Submitter: Richard Smith     Date: 2013-12-05

[Moved to DR at the November, 2014 meeting.]

According to 13.7.6 [temp.spec.partial] paragraph 6,

A class template partial specialization may be declared or redeclared in any namespace scope in which its definition may be defined (13.7.2 [temp.class] and 13.7.3 [temp.mem]).

However, there is nothing in those referenced sections specifying where the definition may appear. Should this have referred to the definition of the primary template?

Also, the cross-reference to 13.7.2 [temp.class] is suspect; the actual rules for where non-member class templates may be defined are found in _N4868_.9.8.2.3 [namespace.memdef] paragraphs 1-2, 9.3.4 [dcl.meaning] paragraph 1, and 9.8.2 [namespace.def] paragraph 8.

(Apropos of 9.8.2 [namespace.def], the description in paragraph 8 mentions explicit instantiation and explicit specialization, but presumably inadvertently omits partial specializations.)

Proposed resolution (February, 2014) [SUPERSEDED]:

Change 13.7.6 [temp.spec.partial] paragraph 6 as follows:

A class template partial specialization may be declared or redeclared in any namespace scope in which its definition the corresponding primary template may be defined (13.7.2 [temp.class] and 13.7.3 [temp.mem]). [Example:...

Additional note, February, 2014:

The proposed resolution approved by CWG at the February, 2014 meeting does not address the additional points raised in the issue, specifically the cross-reference to 13.7.2 [temp.class] and the omission of partial specializations from 9.8.2 [namespace.def]. The issue has been returned to "review" status to consider amending the resolution to include these items.

Proposed Resolution (July, 2014):

  1. Change 9.8.2 [namespace.def] paragraph 8 as follows:

  2. ...Furthermore, each member of the inline namespace can subsequently be partially specialized (13.7.6 [temp.spec.partial]), explicitly instantiated (13.9.3 [temp.explicit]), or explicitly specialized (13.9.4 [temp.expl.spec]) as though it were a member of the enclosing namespace. Finally, looking up a name...
  3. Change 13.7.6 [temp.spec.partial] paragraph 6 as follows:

  4. A class template partial specialization may be declared or redeclared in any namespace scope in which its definition the corresponding primary template may be defined (13.7.2 [temp.class] _N4868_.9.8.2.3 [namespace.memdef] and 13.7.3 [temp.mem]). [Example:...