|
1891 | 1891 | Checking whether \tcode{CI$''$} is satisfied
|
1892 | 1892 | can lead to further normalization of concept-dependent constraints.
|
1893 | 1893 | \end{note}
|
1894 |
| -%FIXME: "_" in the example below is not a valid identifier. |
1895 | 1894 | \begin{example}
|
1896 | 1895 | \begin{codeblock}
|
1897 | 1896 | template<typename>
|
|
1900 | 1899 | template<typename T, template<typename> concept CC>
|
1901 | 1900 | concept D = CC<T>;
|
1902 | 1901 |
|
1903 |
| -template<typename T, |
| 1902 | +template<typename U, |
1904 | 1903 | template<typename> concept CT,
|
1905 | 1904 | template<typename, template<typename> concept> concept CU>
|
1906 |
| -int f() requires CU<T, CT>; |
1907 |
| -int _ = f<int, C, D>(); |
1908 |
| -\end{codeblock} |
1909 |
| -In this example, the associated constraint of \tcode{f} |
1910 |
| -is a concept-dependent constraint $CI$ |
1911 |
| -whose expression is the concept-id \tcode{CU<T, CT>} with the mapping |
1912 |
| -$\tcode{T} \mapsto \tcode{T}, \tcode{CT} \mapsto \tcode{CT}, \tcode{CU} \mapsto \tcode{CU}$.\\ |
1913 |
| -$CI'$ is the result of substituting \tcode{D} into $CI$.\\ |
1914 |
| -We consider the normal form $CI''$ of \tcode{D<T, CT>}, |
| 1905 | +int f() requires CU<U, CT>; |
| 1906 | +int i = f<int, C, D>(); |
| 1907 | +\end{codeblock} |
| 1908 | +In this example, the associated constraints of \tcode{f} |
| 1909 | +consist of a concept-dependent constraint |
| 1910 | +whose expression is the concept-id \tcode{CU<U, CT>} with the mapping |
| 1911 | +$\tcode{U} \mapsto \tcode{U}, \tcode{CT} \mapsto \tcode{CT}, \tcode{CU} \mapsto \tcode{CU}$. |
| 1912 | +The result of substituting \tcode{D} into this expression is \tcode{D<U, CT>}. |
| 1913 | +We consider the normal form of the resulting concept-id, |
1915 | 1914 | which is \tcode{CC<T>} with the mapping
|
1916 |
| -$\tcode{T} \mapsto \tcode{T}, \tcode{CC} \mapsto \tcode{CC}$.\\ |
1917 |
| -By recursion, \tcode{C} is substituted in \tcode{CC<T>} and then |
1918 |
| -normalized to the atomic constraint \tcode{true}, which is satisfied. |
| 1915 | +$\tcode{T} \mapsto \tcode{U}, \tcode{CC} \mapsto \tcode{CT}$. |
| 1916 | +By recursion, \tcode{C} is substituted into \tcode{CC<T>}, and the result |
| 1917 | +is normalized to the atomic constraint \tcode{true}, which is satisfied. |
1919 | 1918 | \end{example}
|
1920 | 1919 |
|
1921 | 1920 | \rSec3[temp.constr.fold]{Fold expanded constraint}
|
|
0 commit comments