Skip to content

Commit 10193f8

Browse files
Dawn Perchikzygoloid
authored andcommitted
P0702R1 Language support for Constructor Template Argument Deduction
Reverse order of "For each constructor of C, if C is defined," to "If C is defined, for each constructor of C," for clarity and to parallel adjacent "If C is not defined" bullet.
1 parent 2658c74 commit 10193f8

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

source/overloading.tex

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,33 +1387,31 @@
13871387
\indextext{deduction!class template arguments}%
13881388

13891389
\pnum
1390-
A set of functions and function templates is formed comprising:
1391-
1390+
When resolving a placeholder for a deduced class type~(\ref{dcl.type.class.deduct})
1391+
where the \grammarterm{template-name} names a primary class template \tcode{C},
1392+
a set of functions and function templates is formed comprising:
13921393
\begin{itemize}
13931394
\item
1394-
For each constructor
1395-
of the primary class template
1396-
designated by the \grammarterm{template-name},
1397-
if the template is defined,
1395+
If \tcode{C} is defined,
1396+
for each constructor of \tcode{C},
13981397
a function template with the following properties:
13991398
\begin{itemize}
14001399
\item
1401-
The template parameters are the template parameters of the class template
1400+
The template parameters are the template parameters of \tcode{C}
14021401
followed
14031402
by the template parameters (including default template arguments) of the constructor,
14041403
if any.
14051404
\item
14061405
The types of the function parameters are those of the constructor.
14071406
\item
14081407
The return type is the class template specialization
1409-
designated by the \grammarterm{template-name}
1408+
designated by \tcode{C}
14101409
and template arguments
1411-
corresponding to the template parameters
1412-
obtained from the class template.
1410+
corresponding to the template parameters of \tcode{C}.
14131411
\end{itemize}
14141412

14151413
\item
1416-
If the primary class template \tcode{C}
1414+
If \tcode{C}
14171415
is not defined or does not declare any constructors,
14181416
an additional function template derived as above
14191417
from a hypothetical constructor \tcode{C()}.
@@ -1448,7 +1446,14 @@
14481446
the selected functions and function templates are considered to be the
14491447
constructors of that class type for the purpose of forming an overload
14501448
set, and the initializer is provided by the context in which class
1451-
template argument deduction was performed. Each such notional constructor
1449+
template argument deduction was performed.
1450+
As an exception, the first phase in \ref{over.match.list}
1451+
(considering initializer-list constructors)
1452+
is omitted if the initializer list consists of
1453+
a single expression of type \cv{}~\tcode{U},
1454+
where \tcode{U} is a specialization of \tcode{C} or
1455+
a class derived from a specialization of \tcode{C}.
1456+
Each such notional constructor
14521457
is considered to be explicit if the function or function template was
14531458
generated from a constructor or \grammarterm{deduction-guide} that was
14541459
declared \tcode{explicit}.

0 commit comments

Comments
 (0)