|
8 | 8 | \indextext{type generator|see{template}}
|
9 | 9 |
|
10 | 10 | \pnum
|
11 |
| -A \term{template} defines a family of classes, functions, or variables, or an alias for a |
| 11 | +A \defn{template} defines a family of classes, functions, or variables, or an alias for a |
12 | 12 | family of types.
|
13 | 13 |
|
14 | 14 | \indextext{\idxcode{template}}%
|
|
56 | 56 | if its \grammarterm{declaration} defines a function, a class, a variable, or a
|
57 | 57 | static data member. A declaration introduced by a template declaration of a
|
58 | 58 | \indextext{variable template!definition of}%
|
59 |
| -\indextext{template!variable}% |
60 |
| -\indextext{template!static data member}% |
61 |
| -variable is a \term{variable template}. A variable template at class scope is a |
62 |
| -\term{static data member template}. |
| 59 | +variable is a \defnx{variable template}{template!variable}. A variable template at class scope is a |
| 60 | +\defnx{static data member template}{template!static data member}. |
63 | 61 |
|
64 | 62 | \begin{example}
|
65 | 63 | \begin{codeblock}
|
|
373 | 371 |
|
374 | 372 | \pnum
|
375 | 373 | A
|
376 |
| -\term{default template-argument} |
| 374 | +\defnx{default template-argument}{\idxgram{template-argument}!default} |
377 | 375 | is a
|
378 | 376 | \grammarterm{template-argument}~(\ref{temp.arg}) specified after
|
379 | 377 | \tcode{=}
|
|
1358 | 1356 | \rSec2[temp.class]{Class templates}
|
1359 | 1357 |
|
1360 | 1358 | \pnum
|
1361 |
| -A class |
1362 |
| -\term{template} |
| 1359 | +A |
| 1360 | +\defnx{class template}{template!class} |
1363 | 1361 | defines the layout and operations
|
1364 | 1362 | for an unbounded set of related types.
|
1365 | 1363 |
|
|
1718 | 1716 | \rSec2[temp.variadic]{Variadic templates}
|
1719 | 1717 |
|
1720 | 1718 | \pnum
|
1721 |
| -A \term{template parameter pack} is a template parameter |
| 1719 | +A \defn{template parameter pack} is a template parameter |
1722 | 1720 | that accepts zero or more template arguments. \begin{example}
|
1723 | 1721 |
|
1724 | 1722 | \begin{codeblock}
|
|
1733 | 1731 | \end{example}
|
1734 | 1732 |
|
1735 | 1733 | \pnum
|
1736 |
| -A \term{function parameter pack} is a function parameter |
| 1734 | +A \defn{function parameter pack} is a function parameter |
1737 | 1735 | that accepts zero or more function arguments. \begin{example}
|
1738 | 1736 |
|
1739 | 1737 | \begin{codeblock}
|
|
1747 | 1745 | \end{example}
|
1748 | 1746 |
|
1749 | 1747 | \pnum
|
1750 |
| -A \term{parameter pack} is either a template parameter |
| 1748 | +A \defn{parameter pack} is either a template parameter |
1751 | 1749 | pack or a function parameter pack.
|
1752 | 1750 |
|
1753 | 1751 | \pnum
|
1754 |
| -A \term{pack expansion} |
1755 |
| -consists of a \term{pattern} and an ellipsis, the instantiation of which |
| 1752 | +\indextext{pattern|see{pack expansion, pattern}}% |
| 1753 | +A \defn{pack expansion} |
| 1754 | +consists of a \defnx{pattern}{pack expansion!pattern} and an ellipsis, the instantiation of which |
1756 | 1755 | produces zero or more instantiations of the pattern in a list (described below).
|
1757 | 1756 | The form of the pattern
|
1758 | 1757 | depends on the context in which the expansion occurs. Pack
|
|
1827 | 1826 | a parameter pack is only expanded by the innermost enclosing pack expansion.
|
1828 | 1827 | The pattern of a pack expansion shall name one or more parameter packs that
|
1829 | 1828 | are not expanded by a nested pack expansion; such parameter packs are called
|
1830 |
| -\term{unexpanded} parameter packs in the pattern. All of the parameter packs expanded |
| 1829 | +\defnx{unexpanded parameter packs}{parameter pack!unexpanded} in the pattern. All of the parameter packs expanded |
1831 | 1830 | by a pack expansion shall have the same number of arguments specified. An
|
1832 | 1831 | appearance of a name of a parameter pack that is not expanded is
|
1833 | 1832 | ill-formed. \begin{example}
|
|
2184 | 2183 | \indextext{specialization!class template partial}%
|
2185 | 2184 | \indextext{template!primary}%
|
2186 | 2185 | A
|
2187 |
| -\term{primary} |
2188 |
| -class template declaration is one in which the class template name is an |
| 2186 | +\defnx{primary class template}{see{template, primary}} |
| 2187 | +declaration is one in which the class template name is an |
2189 | 2188 | identifier.
|
2190 | 2189 | A template declaration in which the class template name is a
|
2191 | 2190 | \grammarterm{simple-template-id}
|
2192 | 2191 | is a
|
2193 |
| -\term{partial specialization} |
| 2192 | +\defnx{partial specialization}{specialization!class template partial} |
2194 | 2193 | of the class template named in the
|
2195 | 2194 | \grammarterm{simple-template-id}.
|
2196 | 2195 | A partial specialization of a class template provides an alternative definition
|
|
2417 | 2416 | \pnum
|
2418 | 2417 | \indextext{more specialized!class template}%
|
2419 | 2418 | For two class template partial specializations,
|
2420 |
| -the first is \term{more specialized} than the second if, given the following |
| 2419 | +the first is \defn{more specialized} than the second if, given the following |
2421 | 2420 | rewrite to two function templates, the first function template is more
|
2422 | 2421 | specialized than the second according to the ordering rules for function
|
2423 | 2422 | templates~(\ref{temp.func.order}):
|
|
2666 | 2665 | \end{note}
|
2667 | 2666 |
|
2668 | 2667 | \pnum
|
| 2668 | +\indextext{equivalent!expression|see{expression, equivalent}}% |
2669 | 2669 | Two expressions involving template parameters are considered
|
2670 |
| -\term{equivalent} |
| 2670 | +\defnx{equivalent}{expression!equivalent} |
2671 | 2671 | if two function definitions containing the expressions would satisfy
|
2672 | 2672 | the one-definition rule~(\ref{basic.def.odr}), except that the tokens used
|
2673 | 2673 | to name the template parameters may differ as long as a token used to
|
|
2692 | 2692 | // was not in scope at the first declaration of \tcode{h()}
|
2693 | 2693 | \end{codeblock}
|
2694 | 2694 | \end{example}
|
| 2695 | +\indextext{equivalent!functionally|see{expression, functionally equivalent}}% |
| 2696 | +\indextext{functionally equivalent!expression|see{expression, functionally equivalent}}% |
2695 | 2697 | Two expressions involving template parameters that are not equivalent are
|
2696 |
| -\term{functionally equivalent} |
| 2698 | +\defnx{functionally equivalent}{expression!functionally equivalent} |
2697 | 2699 | if, for any given set of template arguments, the evaluation of the
|
2698 | 2700 | expression results in the same value.
|
2699 | 2701 |
|
2700 | 2702 | \pnum
|
| 2703 | +\indextext{equivalent!function template|see{template, function, equivalent}}% |
2701 | 2704 | Two function templates are
|
2702 |
| -\term{equivalent} |
| 2705 | +\defnx{equivalent}{template!function!equivalent} |
2703 | 2706 | if they are declared in the same scope, have the same name, have
|
2704 | 2707 | identical template parameter lists, and have return types and parameter
|
2705 | 2708 | lists that are equivalent using the rules described above to compare
|
2706 | 2709 | expressions involving
|
2707 | 2710 | template parameters.
|
| 2711 | +\indextext{equivalent!functionally|see{template, function, functionally equivalent}}% |
| 2712 | +\indextext{functionally equivalent!function template|see{template, function, functionally equivalent}}% |
2708 | 2713 | Two function templates are
|
2709 |
| -\term{functionally equivalent} |
| 2714 | +\defnx{functionally equivalent}{template!function!functionally equivalent} |
2710 | 2715 | if they are equivalent except that one or more
|
2711 | 2716 | expressions
|
2712 | 2717 | that involve template parameters in the return types and parameter
|
|
2745 | 2750 |
|
2746 | 2751 | \pnum
|
2747 | 2752 | \indextext{overloading!resolution!template}%
|
2748 |
| -\indextext{ordering!function template partial}% |
| 2753 | +\indextext{ordering!function template partial|see{template, function, partial ordering}}% |
2749 | 2754 | If a function template is overloaded,
|
2750 | 2755 | the use of a function template specialization might be ambiguous because
|
2751 | 2756 | template argument deduction~(\ref{temp.deduct}) may associate the function
|
2752 | 2757 | template specialization with more than one function template declaration.
|
2753 |
| -\term{Partial ordering} |
| 2758 | +\defnx{Partial ordering}{template!function!partial ordering} |
2754 | 2759 | of overloaded function template declarations is used in the following contexts
|
2755 | 2760 | to select the function template to which a function template specialization
|
2756 | 2761 | refers:
|
|
3550 | 3555 | \rSec2[temp.dep]{Dependent names}
|
3551 | 3556 |
|
3552 | 3557 | \pnum
|
3553 |
| -\indextext{name!dependent}% |
| 3558 | +\indextext{dependent name|see{name, dependent}}% |
3554 | 3559 | Inside a template, some constructs have semantics which may differ from one
|
3555 | 3560 | instantiation to another.
|
3556 | 3561 | Such a construct
|
3557 |
| -\term{depends} |
| 3562 | +\defnx{depends}{name!dependent} |
3558 | 3563 | on the template parameters.
|
3559 | 3564 | In particular, types and expressions may depend on the type
|
3560 | 3565 | and/or
|
|
3581 | 3586 | the
|
3582 | 3587 | \grammarterm{unqualified-id}
|
3583 | 3588 | denotes a
|
3584 |
| -\indextext{name!dependent}% |
3585 |
| -\term{dependent name} |
| 3589 | +\defnx{dependent name}{name!dependent} |
3586 | 3590 | if
|
3587 | 3591 |
|
3588 | 3592 | \begin{itemize}
|
|
3698 | 3702 |
|
3699 | 3703 | \pnum
|
3700 | 3704 | A name refers to the
|
3701 |
| -\term{current instantiation} |
| 3705 | +\defn{current instantiation} |
3702 | 3706 | if it is
|
3703 | 3707 |
|
3704 | 3708 | \begin{itemize}
|
|
3784 | 3788 | \end{example}
|
3785 | 3789 |
|
3786 | 3790 | \pnum
|
3787 |
| -\indextext{base class!dependent}% |
3788 |
| -A \term{dependent base class} is a base class that is a dependent type and is |
| 3791 | +\indextext{dependent base class|see{base class, dependent}}% |
| 3792 | +A \defnx{dependent base class}{base class!dependent} is a base class that is a dependent type and is |
3789 | 3793 | not the current instantiation.
|
3790 | 3794 | \begin{note}
|
3791 | 3795 | A base class can be the current instantiation in the case of a nested class
|
|
3808 | 3812 | \end{note}
|
3809 | 3813 |
|
3810 | 3814 | \pnum
|
3811 |
| -\indextext{instantiation!member of the current}% |
| 3815 | +\indextext{member of the current instantiation|see{instantiation, member of the current}}% |
3812 | 3816 | A name is a
|
3813 |
| -\term{member of the current instantiation} |
| 3817 | +\defnx{member of the current instantiation}{instantiation!member of the current} |
3814 | 3818 | if it is
|
3815 | 3819 |
|
3816 | 3820 | \begin{itemize}
|
|
3863 | 3867 | \end{codeblock}
|
3864 | 3868 | \end{example}
|
3865 | 3869 |
|
3866 |
| -\indextext{instantiation!dependent member of the current}% |
3867 |
| -A name is a \term{dependent member of the current instantiation} if it is a |
| 3870 | +\indextext{dependent member of the current instantiation|see{instantiation, dependent member of the current}}% |
| 3871 | +A name is a \defnx{dependent member of the current instantiation}{instantiation!dependent member of the current} if it is a |
3868 | 3872 | member of the current instantiation that, when looked up, refers to at least
|
3869 | 3873 | one member of a class that is the current instantiation.
|
3870 | 3874 |
|
3871 | 3875 | \pnum
|
3872 | 3876 | A name is a
|
3873 |
| -\term{member of an unknown specialization} |
| 3877 | +\defn{member of an unknown specialization} |
3874 | 3878 | if it is
|
3875 | 3879 |
|
3876 | 3880 | \begin{itemize}
|
|
4443 | 4447 | \indextext{specialization!template}%
|
4444 | 4448 | The act of instantiating a function, a class, a member of a class template or
|
4445 | 4449 | a member template is referred to as
|
4446 |
| -\term{template instantiation}. |
| 4450 | +\defn{template instantiation}. |
4447 | 4451 |
|
4448 | 4452 | \pnum
|
4449 | 4453 | A function instantiated from a function template is called an instantiated
|
|
4796 | 4800 | remain as determined from the context of the definition for the default
|
4797 | 4801 | argument.
|
4798 | 4802 | This analysis is called
|
4799 |
| -\term{default argument instantiation}. |
| 4803 | +\defn{default argument instantiation}. |
4800 | 4804 | The instantiated default argument is then used as the argument of
|
4801 | 4805 | \tcode{f}.
|
4802 | 4806 |
|
|
6724 | 6728 | \end{itemize}
|
6725 | 6729 |
|
6726 | 6730 | \pnum
|
6727 |
| -\indextext{more specialized!function template}% |
6728 | 6731 | \indextext{at least as specialized as|see{more specialized}}%
|
6729 | 6732 | Function template \tcode{F}
|
6730 |
| -is \term{at least as specialized as} |
| 6733 | +is \defnx{at least as specialized as}{more specialized} |
6731 | 6734 | function template \tcode{G} if,
|
6732 | 6735 | for each pair of types used to determine the ordering,
|
6733 | 6736 | the type from \tcode{F}
|
6734 | 6737 | is at least as specialized as
|
6735 | 6738 | the type from \tcode{G}.
|
6736 | 6739 | \tcode{F}
|
6737 |
| -is \term{more specialized than} |
| 6740 | +is \defnx{more specialized than}{more specialized!function template} |
6738 | 6741 | \tcode{G} if
|
6739 | 6742 | \tcode{F}
|
6740 | 6743 | is at least as specialized as
|
|
7042 | 7045 | T&&
|
7043 | 7046 | T[@\grammarterm{integer-constant}@]
|
7044 | 7047 | @\grammarterm{template-name}@<T> @\textrm{(where \tcode{\grammarterm{template-name}} refers to a class template)}@
|
7045 |
| -@\term{type}@(T) |
| 7048 | +@\placeholder{type}@(T) |
7046 | 7049 | T()
|
7047 | 7050 | T(T)
|
7048 |
| -T @\term{type}@::* |
7049 |
| -@\term{type}@ T::* |
| 7051 | +T @\placeholder{type}@::* |
| 7052 | +@\placeholder{type}@ T::* |
7050 | 7053 | T T::*
|
7051 |
| -T (@\term{type}@::*)() |
7052 |
| -@\term{type}@ (T::*)() |
7053 |
| -@\term{type}@ (@\term{type}@::*)(T) |
7054 |
| -@\term{type}@ (T::*)(T) |
7055 |
| -T (@\term{type}@::*)(T) |
| 7054 | +T (@\placeholder{type}@::*)() |
| 7055 | +@\placeholder{type}@ (T::*)() |
| 7056 | +@\placeholder{type}@ (@\placeholder{type}@::*)(T) |
| 7057 | +@\placeholder{type}@ (T::*)(T) |
| 7058 | +T (@\placeholder{type}@::*)(T) |
7056 | 7059 | T (T::*)()
|
7057 | 7060 | T (T::*)(T)
|
7058 |
| -@\term{type}@[i] |
| 7061 | +@\placeholder{type}@[i] |
7059 | 7062 | @\grammarterm{template-name}@<i> @\textrm{(where \tcode{\grammarterm{template-name}} refers to a class template)}@
|
7060 | 7063 | TT<T>
|
7061 | 7064 | TT<i>
|
|
7193 | 7196 | is of the form
|
7194 | 7197 |
|
7195 | 7198 | \begin{codeblock}
|
7196 |
| -@\grammarterm{template-name}@<T> (*)(@\term{type}@[i]) |
| 7199 | +@\grammarterm{template-name}@<T> (*)(@\placeholder{type}@[i]) |
7197 | 7200 | \end{codeblock}
|
7198 | 7201 |
|
7199 | 7202 | which is a variant of
|
7200 | 7203 |
|
7201 | 7204 | \begin{codeblock}
|
7202 |
| -@\term{type}@ (*)(T) |
| 7205 | +@\placeholder{type}@ (*)(T) |
7203 | 7206 | \end{codeblock}
|
7204 | 7207 |
|
7205 | 7208 | where type is
|
|
0 commit comments