|
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}):
|
|
2672 | 2671 | \end{note}
|
2673 | 2672 |
|
2674 | 2673 | \pnum
|
| 2674 | +\indextext{equivalent!expression|see{expression, equivalent}}% |
2675 | 2675 | Two expressions involving template parameters are considered
|
2676 |
| -\term{equivalent} |
| 2676 | +\defnx{equivalent}{expression!equivalent} |
2677 | 2677 | if two function definitions containing the expressions would satisfy
|
2678 | 2678 | the one-definition rule~(\ref{basic.def.odr}), except that the tokens used
|
2679 | 2679 | to name the template parameters may differ as long as a token used to
|
|
2698 | 2698 | // was not in scope at the first declaration of \tcode{h()}
|
2699 | 2699 | \end{codeblock}
|
2700 | 2700 | \end{example}
|
| 2701 | +\indextext{equivalent!functionally|see{expression, functionally equivalent}}% |
| 2702 | +\indextext{functionally equivalent!expression|see{expression, functionally equivalent}}% |
2701 | 2703 | Two expressions involving template parameters that are not equivalent are
|
2702 |
| -\term{functionally equivalent} |
| 2704 | +\defnx{functionally equivalent}{expression!functionally equivalent} |
2703 | 2705 | if, for any given set of template arguments, the evaluation of the
|
2704 | 2706 | expression results in the same value.
|
2705 | 2707 |
|
2706 | 2708 | \pnum
|
| 2709 | +\indextext{equivalent!function template|see{template, function, equivalent}}% |
2707 | 2710 | Two function templates are
|
2708 |
| -\term{equivalent} |
| 2711 | +\defnx{equivalent}{template!function!equivalent} |
2709 | 2712 | if they are declared in the same scope, have the same name, have
|
2710 | 2713 | identical template parameter lists, and have return types and parameter
|
2711 | 2714 | lists that are equivalent using the rules described above to compare
|
2712 | 2715 | expressions involving
|
2713 | 2716 | template parameters.
|
| 2717 | +\indextext{equivalent!functionally|see{template, function, functionally equivalent}}% |
| 2718 | +\indextext{functionally equivalent!function template|see{template, function, functionally equivalent}}% |
2714 | 2719 | Two function templates are
|
2715 |
| -\term{functionally equivalent} |
| 2720 | +\defnx{functionally equivalent}{template!function!functionally equivalent} |
2716 | 2721 | if they are equivalent except that one or more
|
2717 | 2722 | expressions
|
2718 | 2723 | that involve template parameters in the return types and parameter
|
|
2751 | 2756 |
|
2752 | 2757 | \pnum
|
2753 | 2758 | \indextext{overloading!resolution!template}%
|
2754 |
| -\indextext{ordering!function template partial}% |
| 2759 | +\indextext{ordering!function template partial|see{template, function, partial ordering}}% |
2755 | 2760 | If a function template is overloaded,
|
2756 | 2761 | the use of a function template specialization might be ambiguous because
|
2757 | 2762 | template argument deduction~(\ref{temp.deduct}) may associate the function
|
2758 | 2763 | template specialization with more than one function template declaration.
|
2759 |
| -\term{Partial ordering} |
| 2764 | +\defnx{Partial ordering}{template!function!partial ordering} |
2760 | 2765 | of overloaded function template declarations is used in the following contexts
|
2761 | 2766 | to select the function template to which a function template specialization
|
2762 | 2767 | refers:
|
|
3556 | 3561 | \rSec2[temp.dep]{Dependent names}
|
3557 | 3562 |
|
3558 | 3563 | \pnum
|
3559 |
| -\indextext{name!dependent}% |
| 3564 | +\indextext{dependent name|see{name, dependent}}% |
3560 | 3565 | Inside a template, some constructs have semantics which may differ from one
|
3561 | 3566 | instantiation to another.
|
3562 | 3567 | Such a construct
|
3563 |
| -\term{depends} |
| 3568 | +\defnx{depends}{name!dependent} |
3564 | 3569 | on the template parameters.
|
3565 | 3570 | In particular, types and expressions may depend on the type
|
3566 | 3571 | and/or
|
|
3587 | 3592 | the
|
3588 | 3593 | \grammarterm{unqualified-id}
|
3589 | 3594 | denotes a
|
3590 |
| -\indextext{name!dependent}% |
3591 |
| -\term{dependent name} |
| 3595 | +\defnx{dependent name}{name!dependent} |
3592 | 3596 | if
|
3593 | 3597 |
|
3594 | 3598 | \begin{itemize}
|
|
3704 | 3708 |
|
3705 | 3709 | \pnum
|
3706 | 3710 | A name refers to the
|
3707 |
| -\term{current instantiation} |
| 3711 | +\indextext{current instantiation|see{instantiation, current}} |
| 3712 | +\defnx{current instantiation}{instantiation!current} |
3708 | 3713 | if it is
|
3709 | 3714 |
|
3710 | 3715 | \begin{itemize}
|
|
3790 | 3795 | \end{example}
|
3791 | 3796 |
|
3792 | 3797 | \pnum
|
3793 |
| -\indextext{base class!dependent}% |
3794 |
| -A \term{dependent base class} is a base class that is a dependent type and is |
| 3798 | +\indextext{dependent base class|see{base class, dependent}}% |
| 3799 | +A \defnx{dependent base class}{base class!dependent} is a base class that is a dependent type and is |
3795 | 3800 | not the current instantiation.
|
3796 | 3801 | \begin{note}
|
3797 | 3802 | A base class can be the current instantiation in the case of a nested class
|
|
3814 | 3819 | \end{note}
|
3815 | 3820 |
|
3816 | 3821 | \pnum
|
3817 |
| -\indextext{instantiation!member of the current}% |
| 3822 | +\indextext{member of the current instantiation|see{instantiation, member of the current}}% |
3818 | 3823 | A name is a
|
3819 |
| -\term{member of the current instantiation} |
| 3824 | +\defnx{member of the current instantiation}{instantiation!member of the current} |
3820 | 3825 | if it is
|
3821 | 3826 |
|
3822 | 3827 | \begin{itemize}
|
|
3869 | 3874 | \end{codeblock}
|
3870 | 3875 | \end{example}
|
3871 | 3876 |
|
3872 |
| -\indextext{instantiation!dependent member of the current}% |
3873 |
| -A name is a \term{dependent member of the current instantiation} if it is a |
| 3877 | +\indextext{dependent member of the current instantiation|see{instantiation, dependent member of the current}}% |
| 3878 | +A name is a \defnx{dependent member of the current instantiation}{instantiation!dependent member of the current} if it is a |
3874 | 3879 | member of the current instantiation that, when looked up, refers to at least
|
3875 | 3880 | one member of a class that is the current instantiation.
|
3876 | 3881 |
|
3877 | 3882 | \pnum
|
3878 | 3883 | A name is a
|
3879 |
| -\term{member of an unknown specialization} |
| 3884 | +\defn{member of an unknown specialization} |
3880 | 3885 | if it is
|
3881 | 3886 |
|
3882 | 3887 | \begin{itemize}
|
|
4449 | 4454 | \indextext{specialization!template}%
|
4450 | 4455 | The act of instantiating a function, a class, a member of a class template or
|
4451 | 4456 | a member template is referred to as
|
4452 |
| -\term{template instantiation}. |
| 4457 | +\defn{template instantiation}. |
4453 | 4458 |
|
4454 | 4459 | \pnum
|
4455 | 4460 | A function instantiated from a function template is called an instantiated
|
|
4802 | 4807 | remain as determined from the context of the definition for the default
|
4803 | 4808 | argument.
|
4804 | 4809 | This analysis is called
|
4805 |
| -\term{default argument instantiation}. |
| 4810 | +\defn{default argument instantiation}. |
4806 | 4811 | The instantiated default argument is then used as the argument of
|
4807 | 4812 | \tcode{f}.
|
4808 | 4813 |
|
|
6730 | 6735 | \end{itemize}
|
6731 | 6736 |
|
6732 | 6737 | \pnum
|
6733 |
| -\indextext{more specialized!function template}% |
6734 | 6738 | \indextext{at least as specialized as|see{more specialized}}%
|
6735 | 6739 | Function template \tcode{F}
|
6736 |
| -is \term{at least as specialized as} |
| 6740 | +is \defnx{at least as specialized as}{more specialized} |
6737 | 6741 | function template \tcode{G} if,
|
6738 | 6742 | for each pair of types used to determine the ordering,
|
6739 | 6743 | the type from \tcode{F}
|
6740 | 6744 | is at least as specialized as
|
6741 | 6745 | the type from \tcode{G}.
|
6742 | 6746 | \tcode{F}
|
6743 |
| -is \term{more specialized than} |
| 6747 | +is \defnx{more specialized than}{more specialized!function template} |
6744 | 6748 | \tcode{G} if
|
6745 | 6749 | \tcode{F}
|
6746 | 6750 | is at least as specialized as
|
|
7048 | 7052 | T&&
|
7049 | 7053 | T[@\grammarterm{integer-constant}@]
|
7050 | 7054 | @\grammarterm{template-name}@<T> @\textrm{(where \tcode{\grammarterm{template-name}} refers to a class template)}@
|
7051 |
| -@\term{type}@(T) |
| 7055 | +@\placeholder{type}@(T) |
7052 | 7056 | T()
|
7053 | 7057 | T(T)
|
7054 |
| -T @\term{type}@::* |
7055 |
| -@\term{type}@ T::* |
| 7058 | +T @\placeholder{type}@::* |
| 7059 | +@\placeholder{type}@ T::* |
7056 | 7060 | T T::*
|
7057 |
| -T (@\term{type}@::*)() |
7058 |
| -@\term{type}@ (T::*)() |
7059 |
| -@\term{type}@ (@\term{type}@::*)(T) |
7060 |
| -@\term{type}@ (T::*)(T) |
7061 |
| -T (@\term{type}@::*)(T) |
| 7061 | +T (@\placeholder{type}@::*)() |
| 7062 | +@\placeholder{type}@ (T::*)() |
| 7063 | +@\placeholder{type}@ (@\placeholder{type}@::*)(T) |
| 7064 | +@\placeholder{type}@ (T::*)(T) |
| 7065 | +T (@\placeholder{type}@::*)(T) |
7062 | 7066 | T (T::*)()
|
7063 | 7067 | T (T::*)(T)
|
7064 |
| -@\term{type}@[i] |
| 7068 | +@\placeholder{type}@[i] |
7065 | 7069 | @\grammarterm{template-name}@<i> @\textrm{(where \tcode{\grammarterm{template-name}} refers to a class template)}@
|
7066 | 7070 | TT<T>
|
7067 | 7071 | TT<i>
|
|
7199 | 7203 | is of the form
|
7200 | 7204 |
|
7201 | 7205 | \begin{codeblock}
|
7202 |
| -@\grammarterm{template-name}@<T> (*)(@\term{type}@[i]) |
| 7206 | +@\grammarterm{template-name}@<T> (*)(@\placeholder{type}@[i]) |
7203 | 7207 | \end{codeblock}
|
7204 | 7208 |
|
7205 | 7209 | which is a variant of
|
7206 | 7210 |
|
7207 | 7211 | \begin{codeblock}
|
7208 |
| -@\term{type}@ (*)(T) |
| 7212 | +@\placeholder{type}@ (*)(T) |
7209 | 7213 | \end{codeblock}
|
7210 | 7214 |
|
7211 | 7215 | where type is
|
|
0 commit comments