Skip to content

[temp] Replace \term with \defn or \placeholder #1370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 55 additions & 52 deletions source/templates.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
\indextext{type generator|see{template}}

\pnum
A \term{template} defines a family of classes, functions, or variables, or an alias for a
A \defn{template} defines a family of classes, functions, or variables, or an alias for a
family of types.

\indextext{\idxcode{template}}%
Expand Down Expand Up @@ -56,10 +56,8 @@
if its \grammarterm{declaration} defines a function, a class, a variable, or a
static data member. A declaration introduced by a template declaration of a
\indextext{variable template!definition of}%
\indextext{template!variable}%
\indextext{template!static data member}%
variable is a \term{variable template}. A variable template at class scope is a
\term{static data member template}.
variable is a \defnx{variable template}{template!variable}. A variable template at class scope is a
\defnx{static data member template}{template!static data member}.

\begin{example}
\begin{codeblock}
Expand Down Expand Up @@ -373,7 +371,7 @@

\pnum
A
\term{default template-argument}
\defnx{default template-argument}{\idxgram{template-argument}!default}
is a
\grammarterm{template-argument}~(\ref{temp.arg}) specified after
\tcode{=}
Expand Down Expand Up @@ -1358,8 +1356,8 @@
\rSec2[temp.class]{Class templates}

\pnum
A class
\term{template}
A
\defnx{class template}{template!class}
defines the layout and operations
for an unbounded set of related types.

Expand Down Expand Up @@ -1718,7 +1716,7 @@
\rSec2[temp.variadic]{Variadic templates}

\pnum
A \term{template parameter pack} is a template parameter
A \defn{template parameter pack} is a template parameter
that accepts zero or more template arguments. \begin{example}

\begin{codeblock}
Expand All @@ -1733,7 +1731,7 @@
\end{example}

\pnum
A \term{function parameter pack} is a function parameter
A \defn{function parameter pack} is a function parameter
that accepts zero or more function arguments. \begin{example}

\begin{codeblock}
Expand All @@ -1747,12 +1745,13 @@
\end{example}

\pnum
A \term{parameter pack} is either a template parameter
A \defn{parameter pack} is either a template parameter
pack or a function parameter pack.

\pnum
A \term{pack expansion}
consists of a \term{pattern} and an ellipsis, the instantiation of which
\indextext{pattern|see{pack expansion, pattern}}%
A \defn{pack expansion}
consists of a \defnx{pattern}{pack expansion!pattern} and an ellipsis, the instantiation of which
produces zero or more instantiations of the pattern in a list (described below).
The form of the pattern
depends on the context in which the expansion occurs. Pack
Expand Down Expand Up @@ -1827,7 +1826,7 @@
a parameter pack is only expanded by the innermost enclosing pack expansion.
The pattern of a pack expansion shall name one or more parameter packs that
are not expanded by a nested pack expansion; such parameter packs are called
\term{unexpanded} parameter packs in the pattern. All of the parameter packs expanded
\defnx{unexpanded parameter packs}{parameter pack!unexpanded} in the pattern. All of the parameter packs expanded
by a pack expansion shall have the same number of arguments specified. An
appearance of a name of a parameter pack that is not expanded is
ill-formed. \begin{example}
Expand Down Expand Up @@ -2184,13 +2183,13 @@
\indextext{specialization!class template partial}%
\indextext{template!primary}%
A
\term{primary}
class template declaration is one in which the class template name is an
\defnx{primary class template}{see{template, primary}}
declaration is one in which the class template name is an
identifier.
A template declaration in which the class template name is a
\grammarterm{simple-template-id}
is a
\term{partial specialization}
\defnx{partial specialization}{specialization!class template partial}
of the class template named in the
\grammarterm{simple-template-id}.
A partial specialization of a class template provides an alternative definition
Expand Down Expand Up @@ -2417,7 +2416,7 @@
\pnum
\indextext{more specialized!class template}%
For two class template partial specializations,
the first is \term{more specialized} than the second if, given the following
the first is \defn{more specialized} than the second if, given the following
rewrite to two function templates, the first function template is more
specialized than the second according to the ordering rules for function
templates~(\ref{temp.func.order}):
Expand Down Expand Up @@ -2666,8 +2665,9 @@
\end{note}

\pnum
\indextext{equivalent!expression|see{expression, equivalent}}%
Two expressions involving template parameters are considered
\term{equivalent}
\defnx{equivalent}{expression!equivalent}
if two function definitions containing the expressions would satisfy
the one-definition rule~(\ref{basic.def.odr}), except that the tokens used
to name the template parameters may differ as long as a token used to
Expand All @@ -2692,21 +2692,26 @@
// was not in scope at the first declaration of \tcode{h()}
\end{codeblock}
\end{example}
\indextext{equivalent!functionally|see{expression, functionally equivalent}}%
\indextext{functionally equivalent!expression|see{expression, functionally equivalent}}%
Two expressions involving template parameters that are not equivalent are
\term{functionally equivalent}
\defnx{functionally equivalent}{expression!functionally equivalent}
if, for any given set of template arguments, the evaluation of the
expression results in the same value.

\pnum
\indextext{equivalent!function template|see{template, function, equivalent}}%
Two function templates are
\term{equivalent}
\defnx{equivalent}{template!function!equivalent}
if they are declared in the same scope, have the same name, have
identical template parameter lists, and have return types and parameter
lists that are equivalent using the rules described above to compare
expressions involving
template parameters.
\indextext{equivalent!functionally|see{template, function, functionally equivalent}}%
\indextext{functionally equivalent!function template|see{template, function, functionally equivalent}}%
Two function templates are
\term{functionally equivalent}
\defnx{functionally equivalent}{template!function!functionally equivalent}
if they are equivalent except that one or more
expressions
that involve template parameters in the return types and parameter
Expand Down Expand Up @@ -2745,12 +2750,12 @@

\pnum
\indextext{overloading!resolution!template}%
\indextext{ordering!function template partial}%
\indextext{ordering!function template partial|see{template, function, partial ordering}}%
If a function template is overloaded,
the use of a function template specialization might be ambiguous because
template argument deduction~(\ref{temp.deduct}) may associate the function
template specialization with more than one function template declaration.
\term{Partial ordering}
\defnx{Partial ordering}{template!function!partial ordering}
of overloaded function template declarations is used in the following contexts
to select the function template to which a function template specialization
refers:
Expand Down Expand Up @@ -3550,11 +3555,11 @@
\rSec2[temp.dep]{Dependent names}

\pnum
\indextext{name!dependent}%
\indextext{dependent name|see{name, dependent}}%
Inside a template, some constructs have semantics which may differ from one
instantiation to another.
Such a construct
\term{depends}
\defnx{depends}{name!dependent}
on the template parameters.
In particular, types and expressions may depend on the type
and/or
Expand All @@ -3581,8 +3586,7 @@
the
\grammarterm{unqualified-id}
denotes a
\indextext{name!dependent}%
\term{dependent name}
\defnx{dependent name}{name!dependent}
if

\begin{itemize}
Expand Down Expand Up @@ -3698,7 +3702,7 @@

\pnum
A name refers to the
\term{current instantiation}
\defn{current instantiation}
if it is

\begin{itemize}
Expand Down Expand Up @@ -3784,8 +3788,8 @@
\end{example}

\pnum
\indextext{base class!dependent}%
A \term{dependent base class} is a base class that is a dependent type and is
\indextext{dependent base class|see{base class, dependent}}%
A \defnx{dependent base class}{base class!dependent} is a base class that is a dependent type and is
not the current instantiation.
\begin{note}
A base class can be the current instantiation in the case of a nested class
Expand All @@ -3808,9 +3812,9 @@
\end{note}

\pnum
\indextext{instantiation!member of the current}%
\indextext{member of the current instantiation|see{current instantiation, member of the}}%
A name is a
\term{member of the current instantiation}
\defnx{member of the current instantiation}{current instantiation!member of the}
if it is

\begin{itemize}
Expand Down Expand Up @@ -3863,14 +3867,14 @@
\end{codeblock}
\end{example}

\indextext{instantiation!dependent member of the current}%
A name is a \term{dependent member of the current instantiation} if it is a
\indextext{dependent member of the current instantiation|see{current instantiation, dependent member of the}}%
A name is a \defnx{dependent member of the current instantiation}{current instantiation!dependent member of the} if it is a
member of the current instantiation that, when looked up, refers to at least
one member of a class that is the current instantiation.

\pnum
A name is a
\term{member of an unknown specialization}
\defn{member of an unknown specialization}
if it is

\begin{itemize}
Expand Down Expand Up @@ -4443,7 +4447,7 @@
\indextext{specialization!template}%
The act of instantiating a function, a class, a member of a class template or
a member template is referred to as
\term{template instantiation}.
\defn{template instantiation}.

\pnum
A function instantiated from a function template is called an instantiated
Expand Down Expand Up @@ -4796,7 +4800,7 @@
remain as determined from the context of the definition for the default
argument.
This analysis is called
\term{default argument instantiation}.
\defn{default argument instantiation}.
The instantiated default argument is then used as the argument of
\tcode{f}.

Expand Down Expand Up @@ -6724,17 +6728,16 @@
\end{itemize}

\pnum
\indextext{more specialized!function template}%
\indextext{at least as specialized as|see{more specialized}}%
Function template \tcode{F}
is \term{at least as specialized as}
is \defnx{at least as specialized as}{more specialized}
function template \tcode{G} if,
for each pair of types used to determine the ordering,
the type from \tcode{F}
is at least as specialized as
the type from \tcode{G}.
\tcode{F}
is \term{more specialized than}
is \defnx{more specialized than}{more specialized!function template}
\tcode{G} if
\tcode{F}
is at least as specialized as
Expand Down Expand Up @@ -7042,20 +7045,20 @@
T&&
T[@\grammarterm{integer-constant}@]
@\grammarterm{template-name}@<T> @\textrm{(where \tcode{\grammarterm{template-name}} refers to a class template)}@
@\term{type}@(T)
@\placeholder{type}@(T)
T()
T(T)
T @\term{type}@::*
@\term{type}@ T::*
T @\placeholder{type}@::*
@\placeholder{type}@ T::*
T T::*
T (@\term{type}@::*)()
@\term{type}@ (T::*)()
@\term{type}@ (@\term{type}@::*)(T)
@\term{type}@ (T::*)(T)
T (@\term{type}@::*)(T)
T (@\placeholder{type}@::*)()
@\placeholder{type}@ (T::*)()
@\placeholder{type}@ (@\placeholder{type}@::*)(T)
@\placeholder{type}@ (T::*)(T)
T (@\placeholder{type}@::*)(T)
T (T::*)()
T (T::*)(T)
@\term{type}@[i]
@\placeholder{type}@[i]
@\grammarterm{template-name}@<i> @\textrm{(where \tcode{\grammarterm{template-name}} refers to a class template)}@
TT<T>
TT<i>
Expand Down Expand Up @@ -7193,13 +7196,13 @@
is of the form

\begin{codeblock}
@\grammarterm{template-name}@<T> (*)(@\term{type}@[i])
@\grammarterm{template-name}@<T> (*)(@\placeholder{type}@[i])
\end{codeblock}

which is a variant of

\begin{codeblock}
@\term{type}@ (*)(T)
@\placeholder{type}@ (*)(T)
\end{codeblock}

where type is
Expand Down