You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Otherwise, if the type of the expression is T, the result has type “pointer to T” and is a prvalue that is the address of the designated object ([intro.memory]) or a pointer to the designated function.
«The result of a prvalue is the value that the expression stores into its context.» ([basic.lval]). The lvalue can be of type T, but denote an object of type U, so the type of the result of applying the address-of operator to it will be pointer to U, not pointer to T (and I'm unsure if we even can talk about the type of the result. The result is "pointer to object", the type of the prvalue is pointer to T, but I don't think this makes sense to say that the type of the result is pointer to U). pointer to T is the type of the prvalue, not its result.
the prvalue has the value "pointer to the designated object or function", not "the address of the designated object or a pointer to the designated function."
I don't follow item 1, but I think item 2 and the note could use some embellishment to properly fit into the pointer value framework of [basic.compound].
Suggestion: "Otherwise, if the type of the expression is T, the result is a prvalue of type "pointer to T" whose value is a pointer to the designated object [intro.memory] or function. [ Note: In particular, taking the address of a variable of type "cv T" yields a pointer of type "pointer to cv T". ]"
http://eel.is/c++draft/expr.unary.op#3.sentence-4:
T
, but denote an object of typeU
, so the type of the result of applying the address-of operator to it will bepointer to U
, notpointer to T
(and I'm unsure if we even can talk about the type of the result. The result is "pointer to object", the type of the prvalue ispointer to T
, but I don't think this makes sense to say that the type of the result ispointer to U
).pointer to T
is the type of the prvalue, not its result.The note following the sentence above (http://eel.is/c++draft/expr.unary.op#3.note-1) also needs a fix:
I don't think that addresses have types.
The text was updated successfully, but these errors were encountered: