|
1432 | 1432 | \end{example} |
1433 | 1433 |
|
1434 | 1434 | \pnum |
| 1435 | +When resolving a placeholder for a deduced class type |
| 1436 | +where the \grammarterm{template-name} designates a type |
| 1437 | +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 | + |
| 1448 | +\pnum |
| 1449 | +%FIXME: pull up this iref? |
| 1450 | +%dcl.type.simple is first attached to deduced class type above now |
1435 | 1451 | When resolving a placeholder for a deduced class type\iref{dcl.type.simple} |
1436 | 1452 | where |
1437 | 1453 | the \grammarterm{template-name} or \grammarterm{splice-type-specifier} |
|
1688 | 1704 | \indextext{overloading!argument lists|)}% |
1689 | 1705 | \indextext{overloading!candidate functions|)} |
1690 | 1706 |
|
| 1707 | +\pnum |
| 1708 | +\begin{example} |
| 1709 | +\begin{codeblock} |
| 1710 | +template<typename ... Ts> |
| 1711 | +struct Y { |
| 1712 | + Y(); |
| 1713 | + Y(Ts ...); |
| 1714 | +}; |
| 1715 | +template<template<typename T = char> class X> |
| 1716 | +void f() { |
| 1717 | + X x; // OK, deduces \tcode{Y<char>} |
| 1718 | + X x0{}; // OK, deduces \tcode{Y<char>} |
| 1719 | + X x1{1}; // OK, deduces \tcode{Y<int>} |
| 1720 | + X x2{1, 2}; // error: cannot deduce \tcode{X<T>} from \tcode{Y<int, int>} |
| 1721 | +} |
| 1722 | +template void f<Y>(); |
| 1723 | +\end{codeblock} |
| 1724 | +\end{example} |
| 1725 | + |
1691 | 1726 | \rSec2[over.match.viable]{Viable functions}% |
1692 | 1727 | \indextext{overloading!resolution!viable functions|(} |
1693 | 1728 |
|
|
0 commit comments