Skip to content

Commit a033468

Browse files
jensmaurertkoeppe
authored andcommitted
[std] Use \keyword for 'const_cast'.
1 parent 8e79f69 commit a033468

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

source/basic.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4392,7 +4392,7 @@
43924392
\item
43934393
a
43944394
\begin{itemize}
4395-
\item \tcode{const_cast}\iref{expr.const.cast},
4395+
\item \keyword{const_cast}\iref{expr.const.cast},
43964396
\item \keyword{static_cast}\iref{expr.static.cast},
43974397
\item \tcode{dynamic_cast}\iref{expr.dynamic.cast}, or
43984398
\item \tcode{reinterpret_cast}\iref{expr.reinterpret.cast}

source/compatibility.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2546,7 +2546,7 @@
25462546
be provided.
25472547
If non-volatile semantics are required,
25482548
an explicit
2549-
\tcode{const_cast}
2549+
\keyword{const_cast}
25502550
can be used.
25512551
\howwide
25522552
Seldom.

source/expressions.tex

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,7 +2931,7 @@
29312931
The \tcode{>} token following the
29322932
\grammarterm{type-id} in a \tcode{dynamic_cast},
29332933
\keyword{static_cast}, \tcode{reinterpret_cast}, or
2934-
\tcode{const_cast} can be the product of replacing a
2934+
\keyword{const_cast} can be the product of replacing a
29352935
\tcode{>>} token by two consecutive \tcode{>}
29362936
tokens\iref{temp.names}.
29372937
\end{note}
@@ -3174,7 +3174,7 @@
31743174
A function can change the values of its non-const parameters, but these
31753175
changes cannot affect the values of the arguments except where a
31763176
parameter is of a reference type\iref{dcl.ref}; if the reference is to
3177-
a const-qualified type, \tcode{const_cast} is required to be used to
3177+
a const-qualified type, \keyword{const_cast} is required to be used to
31783178
cast away the constness in order to modify the argument's value. Where a
31793179
parameter is of \tcode{const} reference type a temporary object is
31803180
introduced if
@@ -4131,22 +4131,22 @@
41314131
lvalue-to-rvalue\iref{conv.lval}, array-to-pointer\iref{conv.array},
41324132
and function-to-pointer\iref{conv.func} standard conversions are
41334133
performed on the expression \tcode{v}. Conversions that can be performed explicitly using
4134-
\tcode{const_cast} are listed below. No other conversion shall be
4135-
performed explicitly using \tcode{const_cast}.
4134+
\keyword{const_cast} are listed below. No other conversion shall be
4135+
performed explicitly using \keyword{const_cast}.
41364136

41374137
\pnum
41384138
\begin{note}
41394139
Subject to the restrictions in this subclause, an expression can be cast
4140-
to its own type using a \tcode{const_cast} operator.
4140+
to its own type using a \keyword{const_cast} operator.
41414141
\end{note}
41424142

41434143
\pnum
41444144
For two similar types \tcode{T1} and \tcode{T2}\iref{conv.qual},
41454145
a prvalue of type \tcode{T1} may be explicitly
4146-
converted to the type \tcode{T2} using a \tcode{const_cast}
4146+
converted to the type \tcode{T2} using a \keyword{const_cast}
41474147
if, considering the qualification-decompositions of both types,
41484148
each $P^1_i$ is the same as $P^2_i$ for all $i$.
4149-
The result of a \tcode{const_cast} refers to the original entity.
4149+
The result of a \keyword{const_cast} refers to the original entity.
41504150
\begin{example}
41514151
\begin{codeblock}
41524152
typedef int *A[3]; // array of 3 pointer to \tcode{int}
@@ -4162,7 +4162,7 @@
41624162
\pnum
41634163
For two object types \tcode{T1} and \tcode{T2}, if a pointer to \tcode{T1} can
41644164
be explicitly converted to the type ``pointer to \tcode{T2}'' using a
4165-
\tcode{const_cast}, then the following conversions can also be made:
4165+
\keyword{const_cast}, then the following conversions can also be made:
41664166
\begin{itemize}
41674167
\item an lvalue of type \tcode{T1} can be explicitly converted to an lvalue
41684168
of type \tcode{T2} using the cast \tcode{const_cast<T2\&>};
@@ -4175,7 +4175,7 @@
41754175
\tcode{const_cast<T2\&\&>}.
41764176
\end{itemize}
41774177

4178-
The result of a reference \tcode{const_cast} refers
4178+
The result of a reference \keyword{const_cast} refers
41794179
to the original object if the operand is a glvalue and
41804180
to the result of applying the temporary materialization conversion\iref{conv.rval} otherwise.
41814181

@@ -4189,9 +4189,9 @@
41894189
\begin{note}
41904190
Depending on the type of the object, a write operation through the
41914191
pointer, lvalue or pointer to data member resulting from a
4192-
\tcode{const_cast} that casts away a const-qualifier
4192+
\keyword{const_cast} that casts away a const-qualifier
41934193
\begin{footnote}
4194-
\tcode{const_cast}
4194+
\keyword{const_cast}
41954195
is not limited to conversions that cast away a
41964196
const-qualifier.
41974197
\end{footnote}
@@ -5660,7 +5660,7 @@
56605660
An explicit type conversion can be expressed using functional
56615661
notation\iref{expr.type.conv}, a type conversion operator
56625662
(\tcode{dynamic_cast}, \keyword{static_cast}, \tcode{reinterpret_cast},
5663-
\tcode{const_cast}), or the \term{cast} notation.
5663+
\keyword{const_cast}), or the \term{cast} notation.
56645664

56655665
\begin{bnf}
56665666
\nontermdef{cast-expression}\br
@@ -5678,11 +5678,11 @@
56785678
\indextext{cast!const}%
56795679
\indextext{cast!static}%
56805680
\indextext{cast!reinterpret}%
5681-
\item a \tcode{const_cast}\iref{expr.const.cast},
5681+
\item a \keyword{const_cast}\iref{expr.const.cast},
56825682
\item a \keyword{static_cast}\iref{expr.static.cast},
5683-
\item a \keyword{static_cast} followed by a \tcode{const_cast},
5683+
\item a \keyword{static_cast} followed by a \keyword{const_cast},
56845684
\item a \tcode{reinterpret_cast}\iref{expr.reinterpret.cast}, or
5685-
\item a \tcode{reinterpret_cast} followed by a \tcode{const_cast},
5685+
\item a \tcode{reinterpret_cast} followed by a \keyword{const_cast},
56865686
\end{itemize}
56875687
can be performed using the cast notation of explicit type conversion.
56885688
The same semantic restrictions and behaviors apply, with the exception
@@ -5708,7 +5708,7 @@
57085708
above, the interpretation that appears first in the list is used, even
57095709
if a cast resulting from that interpretation is ill-formed. If a
57105710
conversion can be interpreted in more than one way as a
5711-
\keyword{static_cast} followed by a \tcode{const_cast}, the conversion is
5711+
\keyword{static_cast} followed by a \keyword{const_cast}, the conversion is
57125712
ill-formed.
57135713
\begin{example}
57145714
\begin{codeblock}

source/iterators.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@
12911291

12921292
\pnum
12931293
\begin{note}
1294-
\libconcept{indirectly_writable} has the awkward \tcode{const_cast} expressions to reject
1294+
\libconcept{indirectly_writable} has the awkward \keyword{const_cast} expressions to reject
12951295
iterators with prvalue non-proxy reference types that permit rvalue
12961296
assignment but do not also permit \tcode{const} rvalue assignment.
12971297
Consequently, an iterator type \tcode{I} that returns \tcode{std::string}

source/templates.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@
748748
\begin{footnote}
749749
A \tcode{>} that encloses the \grammarterm{type-id}
750750
of a \tcode{dynamic_cast}, \keyword{static_cast}, \tcode{reinterpret_cast}
751-
or \tcode{const_cast}, or which encloses the \grammarterm{template-argument}{s}
751+
or \keyword{const_cast}, or which encloses the \grammarterm{template-argument}{s}
752752
of a subsequent \grammarterm{template-id}, is considered nested for the purpose
753753
of this description.
754754
\end{footnote}

0 commit comments

Comments
 (0)