<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2520</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="2520"></A><H4>2520.
  
Template signature and default template arguments
</H4>
<B>Section: </B>3.53&#160; [<A href="https://wg21.link/defns.signature.templ">defns.signature.templ</A>]
 &#160;&#160;&#160;

 <B>Status: </B>C++23
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>2022-01-25<BR>


<P>[Accepted as a DR at the February, 2023 meeting.]</P>

<P>According to 3.53 [<A href="https://wg21.link/defns.signature.templ">defns.signature.templ</A>], the signature of a
function template includes:</P>

<BLOCKQUOTE>

name, parameter-type-list, enclosing namespace, return
type, <I>template-head</I>, and
trailing <I>requires-clause</I> (if any)

</BLOCKQUOTE>

<P>The mention of the <I>template-head</I> is a change
from previous versions of the Standard, which referred to
the &#8220;template parameter list&#8221;, in order to
include the <I>requires-clause</I> in the signature.
However, <I>template-head</I> is a syntactic nonterminal
and thus includes everything in that production, including
default template arguments. It seems undesirable to make
the default arguments part of the template signature.</P>

<P><B>CWG 2022-11-11</B></P>

<P>CWG agrees with the suggested direction.</P>

<P><B>Proposed resolution (approved by CWG 2023-02-09):</B></P>

<OL>

<LI>
<P>Change in 3.52 [<A href="https://wg21.link/defns.signature.friend">defns.signature.friend</A>] as follows:</P>

<BLOCKQUOTE>

signature<BR>
&lt;function template&gt;<BR>
name, <I>parameter-type-list</I>,
enclosing namespace, return type, <INS>signature of the</INS> <I>template-head</I>, and
trailing <I>requires-clause</I> (if any)

</BLOCKQUOTE>
</LI>

<LI>
<P>Change in 3.53 [<A href="https://wg21.link/defns.signature.templ">defns.signature.templ</A>] as follows:</P>

<BLOCKQUOTE>

signature<BR>
&lt;friend function template with constraint involving enclosing template parameters&gt;<BR>
name, parameter-type-list,
return type, enclosing class, <INS>signature of the</INS> <I>template-head</I>, and trailing <I>requires-clause</I> (if any)

</BLOCKQUOTE>

</LI>

<LI>
<P>Change in 3.56 [<A href="https://wg21.link/defns.signature.member">defns.signature.member</A>] as follows:</P>

<BLOCKQUOTE>

signature<BR>
&lt;class member function template&gt;<BR>
name, <I>parameter-type-list</I>, class of which the function is a
member, <I>cv-qualifier</I>s (if any), <I>ref-qualifier</I> (if any),
return type (if any), <INS>signature of the</INS> <I>template-head</I>, and
trailing <I>requires-clause</I> (if any)

</BLOCKQUOTE>

</LI>

<LI>
<P>Add a new section in Clause 3 [<A href="https://wg21.link/intro.defs">intro.defs</A>] as follows:</P>

<BLOCKQUOTE class="ins">

signature<BR>
&lt;<I>template-head</I>&gt;<BR>
template parameter list, excluding template parameter names and default arguments, and <I>requires-clause</I> (if any)

</BLOCKQUOTE>

</LI>

</OL>

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