<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1819</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="1819"></A><H4>1819.
  
Acceptable scopes for definition of partial specialization
</H4>
<B>Section: </B>13.7.6.1&#160; [<A href="https://wg21.link/temp.spec.partial.general">temp.spec.partial.general</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD4
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-12-05<BR>


<P>[Moved to DR at the November, 2014 meeting.]</P>



<P>According to 13.7.6 [<A href="https://wg21.link/temp.spec.partial#6">temp.spec.partial</A>] paragraph 6,</P>

<BLOCKQUOTE>

A class template partial specialization may be declared or
redeclared in any namespace scope in which its definition
may be defined (13.7.2 [<A href="https://wg21.link/temp.class">temp.class</A>] and
13.7.3 [<A href="https://wg21.link/temp.mem">temp.mem</A>]).

</BLOCKQUOTE>

<P>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?</P>

<P>Also, the cross-reference to 13.7.2 [<A href="https://wg21.link/temp.class">temp.class</A>] is
suspect; the actual rules for where non-member class templates may
be defined are found in _N4868_.9.8.2.3 [<A href="https://wg21.link/namespace.memdef">namespace.memdef</A>] paragraphs 1-2,
9.3.4 [<A href="https://wg21.link/dcl.meaning#1">dcl.meaning</A>] paragraph 1, and
9.9.2 [<A href="https://wg21.link/namespace.def#8">namespace.def</A>] paragraph 8.</P>

<P>(Apropos of 9.9.2 [<A href="https://wg21.link/namespace.def">namespace.def</A>], the description in
paragraph 8 mentions explicit instantiation and explicit
specialization, but presumably inadvertently omits partial
specializations.)</P>

<P><B>Proposed resolution (February, 2014) [SUPERSEDED]:</B></P>

<P>Change 13.7.6 [<A href="https://wg21.link/temp.spec.partial#6">temp.spec.partial</A>] paragraph 6 as follows:</P>

<BLOCKQUOTE>

A class template partial specialization may be declared or redeclared in
any namespace scope in which <DEL>its definition</DEL> <INS>the
corresponding primary template</INS> may be defined
(13.7.2 [<A href="https://wg21.link/temp.class">temp.class</A>] and
13.7.3 [<A href="https://wg21.link/temp.mem">temp.mem</A>]). [<I>Example:</I>...

</BLOCKQUOTE>

<P><B>Additional note, February, 2014:</B></P>

<P>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 [<A href="https://wg21.link/temp.class">temp.class</A>] and the omission of
partial specializations from 9.9.2 [<A href="https://wg21.link/namespace.def">namespace.def</A>].  The issue has
been returned to "review" status to consider amending the resolution to
include these items.</P>

<P><B>Proposed Resolution (July, 2014):</B></P>

<OL>
<LI><P>Change 9.9.2 [<A href="https://wg21.link/namespace.def#8">namespace.def</A>] paragraph 8 as follows:</P></LI>

<BLOCKQUOTE>

...Furthermore, each member of the inline namespace can
subsequently be <INS>partially specialized
(13.7.6 [<A href="https://wg21.link/temp.spec.partial">temp.spec.partial</A>]),</INS> explicitly instantiated
(13.9.3 [<A href="https://wg21.link/temp.explicit">temp.explicit</A>])<INS>,</INS> or explicitly
specialized (13.9.4 [<A href="https://wg21.link/temp.expl.spec">temp.expl.spec</A>]) as though it were
a member of the enclosing namespace. Finally, looking up a
name...

</BLOCKQUOTE>

<LI><P>Change 13.7.6 [<A href="https://wg21.link/temp.spec.partial#6">temp.spec.partial</A>] paragraph 6 as follows:</P></LI>

<BLOCKQUOTE>

A class template partial specialization may be declared or
redeclared in any namespace scope in which <DEL>its definition</DEL>
<INS>the corresponding primary template</INS>
may be defined (<DEL>13.7.2 [<A href="https://wg21.link/temp.class">temp.class</A>]</DEL>
<INS>_N4868_.9.8.2.3 [<A href="https://wg21.link/namespace.memdef">namespace.memdef</A>]</INS> and
13.7.3 [<A href="https://wg21.link/temp.mem">temp.mem</A>]). [<I>Example:</I>...

</BLOCKQUOTE>

</OL>

<BR><BR>
</BODY>
</HTML>
