Lvalue-to-rvalue conversion
1A glvalue (3.10) of a non-function, non-array typeT
can be converted to a prvalue.53If
T
is an incomplete type, a program that necessitates this conversion is ill-formed.If the object to which the glvalue refers is not an object of type
T
and is not an object ofa type derived from
T
, or if the object is uninitialized, a program that necessitatesthis conversion has undefined behavior. If
T
is a non-class type, the type ofthe prvalue is the cv-unqualified version of
T
.
Otherwise, the type of the prvalue is T
.542When an lvalue-to-rvalue conversion occurs in an unevaluated operand or a
subexpression thereof (Clause 5) the value contained in the referenced object is
not accessed. Otherwise, if the glvalue has a class type, the conversion copy-initializes
a temporary of type
T
from the glvalue and the result of the conversion is
a prvalue forthe temporary.
Otherwise, if the glvalue has (possibly cv-qualified) type
std::nullptr_t
,the prvalue result is a null pointer constant (4.10).
Otherwise, the value contained in the object indicated by the glvalue is the prvalue result.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.