|
1847 | 1847 | Checking whether \tcode{CI$''$} is satisfied |
1848 | 1848 | can lead to further normalization of concept-dependent constraints. |
1849 | 1849 | \end{note} |
1850 | | -%FIXME: "_" in the example below is not a valid identifier. |
1851 | 1850 | \begin{example} |
1852 | 1851 | \begin{codeblock} |
1853 | 1852 | template<typename> |
|
1856 | 1855 | template<typename T, template<typename> concept CC> |
1857 | 1856 | concept D = CC<T>; |
1858 | 1857 |
|
1859 | | -template<typename T, |
| 1858 | +template<typename U, |
1860 | 1859 | template<typename> concept CT, |
1861 | 1860 | 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, |
1871 | 1870 | 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. |
1875 | 1874 | \end{example} |
1876 | 1875 |
|
1877 | 1876 | \rSec3[temp.constr.fold]{Fold expanded constraint} |
|
0 commit comments