Skip to content

Commit a23eddd

Browse files
zygoloidRichard Smith
authored andcommitted
[temp.arg.template] Move example from p2 to more appropriate spot in p3,
as discussed in core-24769 and core-24774.
1 parent 453c921 commit a23eddd

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

source/templates.tex

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,22 @@
12541254
\end{codeblock}
12551255
\exitexample
12561256

1257+
\pnum A \grammarterm{template-argument} matches a template
1258+
\grammarterm{template-parameter} (call it \tcode{P}) when each of the template
1259+
parameters in the \grammarterm{template-parameter-list} of the
1260+
\grammarterm{template-argument}'s corresponding class template or alias template (call
1261+
it \tcode{A}) matches the corresponding template parameter in the
1262+
\grammarterm{template-parameter-list} of \tcode{P}.
1263+
Two template parameters match if they are of the same kind (type, non-type, template),
1264+
for non-type \grammarterm{template-parameter}{s}, their types are
1265+
equivalent~(\ref{temp.over.link}), and for template \grammarterm{template-parameter}{s},
1266+
each of their corresponding \grammarterm{template-parameter}{s} matches, recursively.
1267+
When \tcode{P}'s \grammarterm{template-parameter-list} contains a template parameter
1268+
pack~(\ref{temp.variadic}), the template parameter pack will match zero or more template
1269+
parameters or template parameter packs in the \grammarterm{template-parameter-list} of
1270+
\tcode{A} with the same type and form as the template parameter pack in \tcode{P}
1271+
(ignoring whether those template parameters are template parameter packs).
1272+
12571273
\enterexample
12581274
\begin{codeblock}
12591275
template<class T> class A { /* ... */ };
@@ -1273,22 +1289,7 @@
12731289
\end{codeblock}
12741290
\exitexample
12751291

1276-
\pnum A \grammarterm{template-argument} matches a template
1277-
\grammarterm{template-parameter} (call it \tcode{P}) when each of the template
1278-
parameters in the \grammarterm{template-parameter-list} of the
1279-
\grammarterm{template-argument}'s corresponding class template or alias template (call
1280-
it \tcode{A}) matches the corresponding template parameter in the
1281-
\grammarterm{template-parameter-list} of \tcode{P}.
1282-
Two template parameters match if they are of the same kind (type, non-type, template),
1283-
for non-type \grammarterm{template-parameter}{s}, their types are
1284-
equivalent~(\ref{temp.over.link}), and for template \grammarterm{template-parameter}{s},
1285-
each of their corresponding \grammarterm{template-parameter}{s} matches, recursively.
1286-
When \tcode{P}'s \grammarterm{template-parameter-list} contains a template parameter
1287-
pack~(\ref{temp.variadic}), the template parameter pack will match zero or more template
1288-
parameters or template parameter packs in the \grammarterm{template-parameter-list} of
1289-
\tcode{A} with the same type and form as the template parameter pack in \tcode{P}
1290-
(ignoring whether those template parameters are template parameter packs) \enterexample
1291-
1292+
\enterexample
12921293
\begin{codeblock}
12931294
template <class T> struct eval;
12941295

0 commit comments

Comments
 (0)