|
1431 | 1431 | \end{codeblock} |
1432 | 1432 | \end{example} |
1433 | 1433 |
|
| 1434 | +\pnum |
| 1435 | +When resolving a placeholder for a deduced class type |
| 1436 | +where the \grammarterm{template-name} |
| 1437 | +designates a type template template parameter \tcode{P}, |
| 1438 | +the type template template argument for \tcode{P} |
| 1439 | +shall be a deducible template. |
| 1440 | +Let \tcode{A} be an alias template |
| 1441 | +whose template parameter list is that of \tcode{P} and |
| 1442 | +whose \grammarterm{defining-type-id} is a \grammarterm{simple-template-id} |
| 1443 | +whose \grammarterm{template-name} designates the type template template argument and |
| 1444 | +whose \grammarterm{template-argument-list} is the template argument list of \tcode{P}. |
| 1445 | +\tcode{A} is then used instead of the original \grammarterm{template-name} |
| 1446 | +to resolve the placeholder. |
| 1447 | + |
1434 | 1448 | \pnum |
1435 | 1449 | When resolving a placeholder for a deduced class type\iref{dcl.type.simple} |
1436 | 1450 | where |
|
1688 | 1702 | \indextext{overloading!argument lists|)}% |
1689 | 1703 | \indextext{overloading!candidate functions|)} |
1690 | 1704 |
|
| 1705 | +\pnum |
| 1706 | +\begin{example} |
| 1707 | +\begin{codeblock} |
| 1708 | +template<typename ... Ts> |
| 1709 | +struct Y { |
| 1710 | + Y(); |
| 1711 | + Y(Ts ...); |
| 1712 | +}; |
| 1713 | +template<template<typename T = char> class X> |
| 1714 | +void f() { |
| 1715 | + X x; // OK, deduces \tcode{Y<char>} |
| 1716 | + X x0{}; // OK, deduces \tcode{Y<char>} |
| 1717 | + X x1{1}; // OK, deduces \tcode{Y<int>} |
| 1718 | + X x2{1, 2}; // error: cannot deduce \tcode{X<T>} from \tcode{Y<int, int>} |
| 1719 | +} |
| 1720 | +template void f<Y>(); |
| 1721 | +\end{codeblock} |
| 1722 | +\end{example} |
| 1723 | + |
1691 | 1724 | \rSec2[over.match.viable]{Viable functions}% |
1692 | 1725 | \indextext{overloading!resolution!viable functions|(} |
1693 | 1726 |
|
|
0 commit comments