<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 582</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="582"></A><H4>582.
  
Template conversion functions
</H4>
<B>Section: </B>13.7.3&#160; [<A href="https://wg21.link/temp.mem">temp.mem</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>PremAnand Rao
 &#160;&#160;&#160;

 <B>Date: </B>23 May 2006<BR>


<P>[Voted into WP at April, 2007 meeting.]</P>

<P>The wholesale replacement of the phrase &#8220;template
function&#8221; by the resolution of <A HREF="105.html">issue 105</A> seems to have overlooked the similar phrase &#8220;template
conversion function.&#8221; This phrase appears a number of times in
12.2.4.2.3 [<A href="https://wg21.link/over.ics.user#3">over.ics.user</A>] paragraph 3, 13.7.3 [<A href="https://wg21.link/temp.mem">temp.mem</A>] paragraphs 5-8, and 13.10.3 [<A href="https://wg21.link/temp.deduct#1">temp.deduct</A>] paragraph 1.
  It should be systematically replaced in similar
fashion to the resolution of <A HREF="105.html">issue 105</A>.</P>

<P><B>Proposed resolution (October, 2006):</B></P>

<OL>
<LI><P>Change 12.2.4.2.3 [<A href="https://wg21.link/over.ics.user#3">over.ics.user</A>] paragraph 3 as
follows:</P></LI>

<BLOCKQUOTE>

If the user-defined conversion is specified by a <DEL>template
conversion function</DEL> <INS>specialization of a conversion function
template</INS>, the second standard conversion sequence must have exact
match rank.

</BLOCKQUOTE>

<LI><P>Change 13.7.3 [<A href="https://wg21.link/temp.mem#5">temp.mem</A>] paragraph 5 as follows:</P></LI>

<BLOCKQUOTE>

A specialization of a <DEL>template conversion
function</DEL> <INS>conversion function template</INS> is referenced in the
same way as a non-template conversion function that converts to the
same type.

</BLOCKQUOTE>

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

<BLOCKQUOTE>

A specialization of a <DEL>template conversion
function</DEL> <INS>conversion function template</INS> is not found by name
lookup. Instead, any <DEL>template conversion
functions</DEL> <INS>conversion function templates</INS> visible in the
context of the use are considered.

</BLOCKQUOTE>

<LI><P>Change 13.7.3 [<A href="https://wg21.link/temp.mem#7">temp.mem</A>] paragraph 7 as follows:</P></LI>

<BLOCKQUOTE>

A <DEL>using-declaration</DEL> <INS><I>using-declaration</I></INS> in a
derived class cannot refer to a specialization of a <DEL>template
conversion function</DEL> <INS>conversion function template</INS> in a base
class.

</BLOCKQUOTE>

<LI><P>Change 13.7.3 [<A href="https://wg21.link/temp.mem#8">temp.mem</A>] paragraph 8 as follows:</P></LI>

<BLOCKQUOTE>

Overload resolution (12.2.4.3 [<A href="https://wg21.link/over.ics.rank">over.ics.rank</A>]) and partial
ordering (13.7.7.3 [<A href="https://wg21.link/temp.func.order">temp.func.order</A>]) are used to select the
best conversion function among multiple <DEL>template conversion
functions</DEL> <INS>specializations of conversion function templates</INS>
and/or non-template conversion functions.

</BLOCKQUOTE>

<LI><P>Change 13.10.3.4 [<A href="https://wg21.link/temp.deduct.conv#1">temp.deduct.conv</A>] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

Template argument deduction is done by comparing the return type of
the <DEL>template conversion function</DEL> <INS>conversion function
template</INS> (call it <TT>P</TT>) with the type that is required as
the result of the conversion (call it <TT>A</TT>) as described in
13.10.3.6 [<A href="https://wg21.link/temp.deduct.type">temp.deduct.type</A>].

</BLOCKQUOTE>

</OL>

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