Skip to content

Commit 751924f

Browse files
jensmaurerzygoloid
authored andcommitted
[core] Use \keyword to introduce 'template'.
1 parent cd729c4 commit 751924f

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

source/basic.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@
310310
an array operand, the set contains the potential results of that operand.
311311
\item If $E$ is a class member access
312312
expression\iref{expr.ref} of the form
313-
$E_1$ \tcode{.} \opt{\tcode{template}} $E_2$
313+
$E_1$ \tcode{.} \opt{\keyword{template}} $E_2$
314314
naming a non-static data member,
315315
the set contains the potential results of $E_1$.
316316
\item If $E$ is a class member access expression

source/expressions.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@
14341434

14351435
\pnum
14361436
A \grammarterm{nested-name-specifier} that denotes a class, optionally
1437-
followed by the keyword \tcode{template}\iref{temp.names}, and then
1437+
followed by the keyword \keyword{template}\iref{temp.names}, and then
14381438
followed by the name of a member of either that class\iref{class.mem}
14391439
or one of its base classes\iref{class.derived}, is a
14401440
\indextext{id!qualified}%
@@ -1459,7 +1459,7 @@
14591459
The \grammarterm{nested-name-specifier} \tcode{::} names the global namespace.
14601460
A \grammarterm{nested-name-specifier} that names a
14611461
namespace\iref{basic.namespace}, optionally followed by the keyword
1462-
\tcode{template}\iref{temp.names}, and then followed by the name of a member
1462+
\keyword{template}\iref{temp.names}, and then followed by the name of a member
14631463
of that namespace (or the name of a member of a namespace made visible by a
14641464
\grammarterm{using-directive}), is a
14651465
\indextext{id!qualified}%
@@ -3211,7 +3211,7 @@
32113211
\indextext{arrow operator|see{operator, class member access}}%
32123212
A postfix expression followed by a dot \tcode{.} or an arrow \tcode{->},
32133213
optionally followed by the keyword
3214-
\tcode{template}\iref{temp.names}, and then followed by an
3214+
\keyword{template}\iref{temp.names}, and then followed by an
32153215
\grammarterm{id-expression}, is a postfix expression. The postfix
32163216
expression before the dot or arrow is evaluated;\footnote{If the class member
32173217
access expression is evaluated, the subexpression evaluation happens even if the

source/grammar.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
\tcode{typedef}\iref{dcl.typedef},
2323
\tcode{namespace}\iref{namespace.def},
2424
class\iref{class}, enumeration\iref{dcl.enum}, and
25-
\tcode{template}\iref{temp}
25+
\keyword{template}\iref{temp}
2626
declarations.
2727

2828
\begin{ncbnf}

source/templates.tex

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,11 @@
319319
to be a
320320
\grammarterm{typedef-name}
321321
(if declared without
322-
\tcode{template})
322+
\keyword{template})
323323
or
324324
\grammarterm{template-name}
325325
(if declared with
326-
\tcode{template})
326+
\keyword{template})
327327
in the scope of the template declaration.
328328
\begin{note}
329329
A template argument may be a class template or alias template.
@@ -764,25 +764,25 @@
764764
\end{example}
765765

766766
\pnum
767-
The keyword \tcode{template} is said to appear at the top level in
767+
The keyword \keyword{template} is said to appear at the top level in
768768
a \grammarterm{qualified-id}
769769
if it appears outside of a \grammarterm{template-argument-list} or
770770
\grammarterm{decltype-specifier}.
771771
In a \grammarterm{qualified-id} of a \grammarterm{declarator-id} or
772772
in a \grammarterm{qualified-id} formed by a \grammarterm{class-head-name}\iref{class.pre} or
773773
\grammarterm{enum-head-name}\iref{dcl.enum},
774-
the keyword \tcode{template} shall not appear at the top level.
774+
the keyword \keyword{template} shall not appear at the top level.
775775
In a \grammarterm{qualified-id} used as the name in a
776776
\grammarterm{typename-specifier}\iref{temp.res},
777777
\grammarterm{elaborated-type-specifier}\iref{dcl.type.elab},
778778
\grammarterm{using-declaration}\iref{namespace.udecl}, or
779779
\grammarterm{class-or-decltype}\iref{class.derived},
780-
an optional keyword \tcode{template} appearing at the top level is ignored.
780+
an optional keyword \keyword{template} appearing at the top level is ignored.
781781
In these contexts, a \tcode{<} token is always assumed to introduce a
782782
\grammarterm{template-argument-list}.
783783
In all other contexts, when naming a template specialization of
784784
a member of an unknown specialization\iref{temp.dep.type},
785-
the member template name shall be prefixed by the keyword \tcode{template}.
785+
the member template name shall be prefixed by the keyword \keyword{template}.
786786
\begin{example}
787787
\begin{codeblock}
788788
struct X {
@@ -800,19 +800,19 @@
800800

801801
\pnum
802802
A name prefixed by the keyword
803-
\tcode{template}
803+
\keyword{template}
804804
shall be a \grammarterm{template-id} or
805805
the name shall refer to a class template or an alias template.
806806
\begin{note}
807807
The keyword
808-
\tcode{template}
808+
\keyword{template}
809809
may not be applied to non-template members of class templates.
810810
\end{note}
811811
\begin{note}
812812
As is the case with the
813813
\tcode{typename}
814814
prefix, the
815-
\tcode{template}
815+
\keyword{template}
816816
prefix is allowed in cases where it is not strictly
817817
necessary; i.e., when the \grammarterm{nested-name-specifier} or
818818
the expression on the left of
@@ -2245,7 +2245,7 @@
22452245
T& elem(int i) { return v[i]; }
22462246
};
22472247
\end{codeblock}
2248-
The prefix \tcode{template<class T>}
2248+
The prefix \tcode{\keyword{template}<class T>}
22492249
specifies that a template is being declared and that a
22502250
\grammarterm{type-name}
22512251
\tcode{T}
@@ -3255,7 +3255,7 @@
32553255
\pnum
32563256
The template parameters are specified in the angle bracket enclosed list
32573257
that immediately follows the keyword
3258-
\tcode{template}.
3258+
\keyword{template}.
32593259
For partial specializations, the template argument list is explicitly
32603260
written immediately following the class template name.
32613261
For primary templates, this list is implicitly described by the
@@ -5991,7 +5991,7 @@
59915991
a variable template, a class template, a member of a class template, or
59925992
a member template.
59935993
An explicit specialization declaration is introduced by
5994-
\tcode{template<>}.
5994+
\tcode{\keyword{template}<>}.
59955995
In an explicit specialization declaration for
59965996
a variable template, a class template,
59975997
a member of a class template or a class member template,
@@ -6839,7 +6839,7 @@
68396839
member function template of a class or class template
68406840
\end{itemize}
68416841
can be declared by a declaration introduced by
6842-
\tcode{template<>};
6842+
\tcode{\keyword{template}<>};
68436843
that is:
68446844
\indextext{\idxgram{explicit-specialization}}%
68456845

@@ -6935,9 +6935,9 @@
69356935
specialization.
69366936
Members of an explicitly specialized
69376937
class template are defined in the same manner as members of normal classes, and
6938-
not using the \tcode{template<>} syntax.
6938+
not using the \tcode{\keyword{template}<>} syntax.
69396939
The same is true when defining a member of an explicitly specialized member
6940-
class. However, \tcode{template<>} is used in defining a member of an explicitly
6940+
class. However, \tcode{\keyword{template}<>} is used in defining a member of an explicitly
69416941
specialized member class template that is specialized as a class template.
69426942
\begin{example}
69436943
\begin{codeblock}
@@ -6955,32 +6955,32 @@
69556955
a.f(16); // \tcode{A<int>::f} must be defined somewhere
69566956
}
69576957

6958-
// \tcode{template<>} not used for a member of an explicitly specialized class template
6958+
// \tcode{\keyword{template}<>} not used for a member of an explicitly specialized class template
69596959
void A<int>::f(int) { @\commentellip@ }
69606960

69616961
template<> struct A<char>::B {
69626962
void f();
69636963
};
6964-
// \tcode{template<>} also not used when defining a member of an explicitly specialized member class
6964+
// \tcode{\keyword{template}<>} also not used when defining a member of an explicitly specialized member class
69656965
void A<char>::B::f() { @\commentellip@ }
69666966

69676967
template<> template<class U> struct A<char>::C {
69686968
void f();
69696969
};
6970-
// \tcode{template<>} is used when defining a member of an explicitly specialized member class template
6970+
// \tcode{\keyword{template}<>} is used when defining a member of an explicitly specialized member class template
69716971
// specialized as a class template
69726972
template<>
69736973
template<class U> void A<char>::C<U>::f() { @\commentellip@ }
69746974

69756975
template<> struct A<short>::B {
69766976
void f();
69776977
};
6978-
template<> void A<short>::B::f() { @\commentellip@ } // error: \tcode{template<>} not permitted
6978+
template<> void A<short>::B::f() { @\commentellip@ } // error: \tcode{\keyword{template}<>} not permitted
69796979

69806980
template<> template<class U> struct A<short>::C {
69816981
void f();
69826982
};
6983-
template<class U> void A<short>::C<U>::f() { @\commentellip@ } // error: \tcode{template<>} required
6983+
template<class U> void A<short>::C<U>::f() { @\commentellip@ } // error: \tcode{\keyword{template}<>} required
69846984
\end{codeblock}
69856985
\end{example}
69866986

@@ -7185,7 +7185,7 @@
71857185
templates.
71867186
In an explicit specialization for such a member,
71877187
the member declaration shall be preceded by a
7188-
\tcode{template<>}
7188+
\tcode{\keyword{template}<>}
71897189
for each enclosing class template that is explicitly specialized.
71907190
\begin{example}
71917191
\begin{codeblock}
@@ -7208,11 +7208,11 @@
72087208
template if its enclosing class templates are not explicitly specialized
72097209
as well.
72107210
In such an explicit specialization declaration, the keyword
7211-
\tcode{template}
7211+
\keyword{template}
72127212
followed by a
72137213
\grammarterm{template-parameter-list}
72147214
shall be provided instead of the
7215-
\tcode{template<>}
7215+
\tcode{\keyword{template}<>}
72167216
preceding the explicit specialization declaration of the member.
72177217
The types of the
72187218
\grammarterm{template-parameter}{s}

source/utilities.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2230,7 +2230,7 @@
22302230
non-member function is that if this functionality had been
22312231
provided as a member function, code where the type
22322232
depended on a template parameter would have required using
2233-
the \tcode{template} keyword.
2233+
the \keyword{template} keyword.
22342234
\end{note}
22352235

22362236
\rSec2[tuple.rel]{Relational operators}

0 commit comments

Comments
 (0)