Skip to content

Commit 3a8185a

Browse files
committed
[temp.constr.concept] Fix example
* Give all template parameters a unique name for clarity * Replace use a of a reserved identifier * Fix the example's accompanying text, in particular the parameter mapping of the normal form of the concept-id after substitution
1 parent be34ebf commit 3a8185a

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

source/templates.tex

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,6 @@
18471847
Checking whether \tcode{CI$''$} is satisfied
18481848
can lead to further normalization of concept-dependent constraints.
18491849
\end{note}
1850-
%FIXME: "_" in the example below is not a valid identifier.
18511850
\begin{example}
18521851
\begin{codeblock}
18531852
template<typename>
@@ -1856,22 +1855,22 @@
18561855
template<typename T, template<typename> concept CC>
18571856
concept D = CC<T>;
18581857

1859-
template<typename T,
1858+
template<typename U,
18601859
template<typename> concept CT,
18611860
template<typename, template<typename> concept> concept CU>
1862-
int f() requires CU<T, CT>;
1863-
int _ = f<int, C, D>();
1864-
\end{codeblock}
1865-
In this example, the associated constraint of \tcode{f}
1866-
is a concept-dependent constraint $CI$
1867-
whose expression is the concept-id \tcode{CU<T, CT>} with the mapping
1868-
$\tcode{T} \mapsto \tcode{T}, \tcode{CT} \mapsto \tcode{CT}, \tcode{CU} \mapsto \tcode{CU}$.\\
1869-
$CI'$ is the result of substituting \tcode{D} into $CI$.\\
1870-
We consider the normal form $CI''$ of \tcode{D<T, CT>},
1861+
int f() requires CU<U, CT>;
1862+
int i = f<int, C, D>();
1863+
\end{codeblock}
1864+
In this example, the associated constraints of \tcode{f}
1865+
consist of a concept-dependent constraint
1866+
whose expression is the concept-id \tcode{CU<U, CT>} with the mapping
1867+
$\tcode{U} \mapsto \tcode{U}, \tcode{CT} \mapsto \tcode{CT}, \tcode{CU} \mapsto \tcode{CU}$.
1868+
The result of substituting \tcode{D} into this expression is \tcode{D<U, CT>}.
1869+
We consider the normal form of the resulting concept-id,
18711870
which is \tcode{CC<T>} with the mapping
1872-
$\tcode{T} \mapsto \tcode{T}, \tcode{CC} \mapsto \tcode{CC}$.\\
1873-
By recursion, \tcode{C} is substituted in \tcode{CC<T>} and then
1874-
normalized to the atomic constraint \tcode{true}, which is satisfied.
1871+
$\tcode{T} \mapsto \tcode{U}, \tcode{CC} \mapsto \tcode{CT}$.
1872+
By recursion, \tcode{C} is substituted into \tcode{CC<T>}, and the result
1873+
is normalized to the atomic constraint \tcode{true}, which is satisfied.
18751874
\end{example}
18761875

18771876
\rSec3[temp.constr.fold]{Fold expanded constraint}

0 commit comments

Comments
 (0)