Skip to content

Commit 35b73d1

Browse files
committed
[temp.variadic] Clarify what the elements of pack expansions are.
Also some minor wording cleanups: strike a stray "identifier" and make paragraph 3 properly parallel to paragraphs 1 and 2.
1 parent d307bf4 commit 35b73d1

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

source/templates.tex

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,7 @@
25392539

25402540
\pnum
25412541
An \defnx{\grammarterm{init-capture} pack}{init-capture pack@\fakegrammarterm{init-capture} pack}
2542-
introduces an \grammarterm{init-capture}
2542+
is a lambda capture that introduces an \grammarterm{init-capture}
25432543
for each of the elements in the pack expansion of its \grammarterm{initializer}.
25442544
\begin{example}
25452545
\begin{codeblock}
@@ -2562,7 +2562,7 @@
25622562
or an \grammarterm{init-capture} pack.
25632563
The number of elements of a template parameter pack
25642564
or a function parameter pack
2565-
is the number of arguments provided for the parameter pack \grammarterm{identifier}.
2565+
is the number of arguments provided for the parameter pack.
25662566
The number of elements of an \grammarterm{init-capture} pack
25672567
is the number of elements in the pack expansion of its \grammarterm{initializer}.
25682568

@@ -2681,37 +2681,40 @@
26812681
that is neither a \tcode{sizeof...} expression
26822682
nor a \grammarterm{fold-expression}
26832683
produces a
2684-
list
2685-
$\mathtt{E}_1, \mathtt{E}_2, \dotsc, \mathtt{E}_N$,
2684+
list of elements
2685+
$\mathtt{E}_1,$ $\mathtt{E}_2,$ $\cdots,$ $\mathtt{E}_N$,
26862686
where
26872687
$N$ is the number of elements in the pack expansion parameters. Each
26882688
$\mathtt{E}_i$ is generated by instantiating the pattern and
2689-
replacing each pack expansion parameter with its $i$th element.
2689+
replacing each pack expansion parameter with its $i^{\textrm{th}}$ element.
26902690
Such an element, in the context of the instantiation, is interpreted as
26912691
follows:
26922692

26932693
\begin{itemize}
26942694
\item
26952695
if the pack is a template parameter pack, the element is a template
26962696
parameter\iref{temp.param} of the corresponding kind (type or
2697-
non-type) designating the type or value from the template
2698-
argument;
2697+
non-type) designating the $i^{\textrm{th}}$
2698+
corresponding type or value template argument;
26992699

27002700
\item
27012701
if the pack is a function parameter pack, the element is an
27022702
\grammarterm{id-expression}
2703-
designating the function parameter that resulted from
2704-
the instantiation of the pattern where the pack is declared;
2703+
designating the $i^{\textrm{th}}$ function parameter
2704+
that resulted from instantiation of
2705+
the function parameter pack declaration;
27052706
otherwise
27062707

27072708
\item
27082709
if the pack is an \grammarterm{init-capture} pack,
27092710
the element is an \grammarterm{id-expression}
2710-
designating the variable declared by the \grammarterm{init-capture}
2711-
that resulted from the instantiation of the pattern where the pack is declared.
2711+
designating the variable introduced by
2712+
the $i^{\textrm{th}}$ \grammarterm{init-capture}
2713+
that resulted from instantiation of
2714+
the \grammarterm{init-capture} pack.
27122715
\end{itemize}
27132716

2714-
All of the $\mathtt{E}_i$ become elements in the enclosing list.
2717+
All of the $\mathtt{E}_i$ become items in the enclosing list.
27152718
\begin{note} The variety of list varies with the context:
27162719
\grammarterm{expression-list},
27172720
\grammarterm{base-specifier-list},

0 commit comments

Comments
 (0)