|
1771 | 1771 | The formation of the associated constraints
|
1772 | 1772 | establishes the order in which constraints are instantiated when checking
|
1773 | 1773 | for satisfaction\iref{temp.constr.constr}.
|
| 1774 | + |
| 1775 | +\newpage |
| 1776 | + |
1774 | 1777 | \begin{example}
|
1775 | 1778 | \begin{codeblock}
|
1776 | 1779 | template<typename T> concept C = true;
|
|
5273 | 5276 | A<T>::type i; // OK: refers to a member of the current instantiation
|
5274 | 5277 | typename A<T>::other j; // error: neither a member of the current instantiation nor
|
5275 | 5278 | // a member of an unknown specialization
|
| 5279 | +@\newpage@ |
5276 | 5280 | }
|
5277 | 5281 | };
|
5278 | 5282 | \end{codeblock}
|
|
5749 | 5753 | not just considering those declarations found in the template definition and
|
5750 | 5754 | template instantiation contexts, then the program has undefined behavior.
|
5751 | 5755 |
|
| 5756 | +\newpage |
| 5757 | + |
5752 | 5758 | \pnum
|
5753 | 5759 | \begin{example}
|
5754 | 5760 | \begin{codeblocktu}{Source file \tcode{"X.h"}}
|
|
5984 | 5990 | a member function template,
|
5985 | 5991 | the name of the function or member function explicitly specialized may be a
|
5986 | 5992 | \grammarterm{template-id}.
|
| 5993 | + |
| 5994 | +\newpage |
| 5995 | + |
5987 | 5996 | \begin{example}
|
5988 | 5997 | \begin{codeblock}
|
5989 | 5998 | template<class T = int> struct A {
|
|
7717 | 7726 | \end{example}
|
7718 | 7727 | \item
|
7719 | 7728 | Attempting to use a type that is not a class or enumeration type in a qualified name.
|
| 7729 | + |
| 7730 | +\newpage |
| 7731 | + |
7720 | 7732 | \begin{example}
|
7721 | 7733 | \begin{codeblock}
|
7722 | 7734 | template <class T> int f(typename T::B*);
|
|
7891 | 7903 | When a function parameter pack appears in a non-deduced
|
7892 | 7904 | context\iref{temp.deduct.type}, the type of that pack is
|
7893 | 7905 | never deduced.
|
| 7906 | + |
| 7907 | +\newpage |
| 7908 | + |
7894 | 7909 | \begin{example}
|
7895 | 7910 | \begin{codeblock}
|
7896 | 7911 | template<class ... Types> void f(Types& ...);
|
|
8397 | 8412 |
|
8398 | 8413 | f(); // calls \#1
|
8399 | 8414 | f(1, 2, 3); // calls \#2
|
| 8415 | +@\newpage@ |
8400 | 8416 | f(1, 2); // calls \#3; non-variadic template \#3 is more specialized
|
8401 | 8417 | // than the variadic templates \#1 and \#2
|
8402 | 8418 | \end{codeblock}
|
|
9054 | 9070 | can be deduced from a function, pointer to function, or
|
9055 | 9071 | pointer-to-member-function type.
|
9056 | 9072 |
|
| 9073 | +\newpage |
| 9074 | + |
9057 | 9075 | \begin{example}
|
9058 | 9076 | \begin{codeblock}
|
9059 | 9077 | template<class T> void f(void(*)(T,int));
|
|
0 commit comments