|
266 | 266 | \end{note}
|
267 | 267 |
|
268 | 268 | \pnum
|
269 |
| -Unless otherwise specified\iref{expr.const.cast}, |
| 269 | +Unless otherwise specified\iref{expr.reinterpret.cast, expr.const.cast}, |
270 | 270 | whenever a prvalue appears as an operand of an operator that
|
271 | 271 | expects a glvalue for that operand, the
|
272 | 272 | temporary materialization conversion\iref{conv.rval} is
|
|
4432 | 4432 | \tcode{T2}'' (where \tcode{T1} and \tcode{T2} are function types) and
|
4433 | 4433 | back to its original type yields the original pointer value, the result
|
4434 | 4434 | of such a pointer conversion is unspecified.
|
4435 |
| -\begin{note} |
4436 |
| -See also~\ref{conv.ptr} for more details of pointer conversions. |
4437 |
| -\end{note} |
4438 | 4435 |
|
4439 | 4436 | \pnum
|
4440 | 4437 | An object pointer
|
|
4509 | 4506 | \indextext{cast!reinterpret!reference}%
|
4510 | 4507 | \indextext{cast!reference}%
|
4511 | 4508 | \indextext{type pun}%
|
4512 |
| -A glvalue of type \tcode{T1}, |
| 4509 | +If \tcode{v} is a glvalue of type \tcode{T1}, |
4513 | 4510 | designating an object or function \placeholder{x},
|
4514 |
| -can be cast to the type ``reference to \tcode{T2}'' |
| 4511 | +it can be cast to the type ``reference to \tcode{T2}'' |
4515 | 4512 | if an expression of type ``pointer to \tcode{T1}''
|
4516 | 4513 | can be explicitly converted to the type ``pointer to \tcode{T2}''
|
4517 | 4514 | using a \keyword{reinterpret_cast}.
|
4518 | 4515 | The result is that of \tcode{*reinterpret_cast<T2 *>(p)}
|
4519 | 4516 | where \tcode{p} is a pointer to \placeholder{x}
|
4520 | 4517 | of type ``pointer to \tcode{T1}''.
|
4521 |
| -No temporary is created, no copy is made, and |
| 4518 | +\begin{note} |
| 4519 | +No temporary is materialized\iref{conv.rval} or created, |
| 4520 | +no copy is made, and |
4522 | 4521 | no constructors\iref{class.ctor} or conversion
|
4523 | 4522 | functions\iref{class.conv} are called.
|
4524 | 4523 | \begin{footnote}
|
4525 | 4524 | This is sometimes referred to as a type pun
|
4526 | 4525 | when the result refers to the same object as the source glvalue.
|
4527 | 4526 | \end{footnote}
|
| 4527 | +\end{note} |
4528 | 4528 |
|
4529 | 4529 | \rSec3[expr.const.cast]{Const cast}
|
4530 | 4530 |
|
|
0 commit comments