Date: Mon, 23 Dec 2024 17:20:29 -0300
On Monday 23 December 2024 17:05:07 Brasilia Standard Time Vladimir Grigoriev
via Std-Discussion wrote:
> «1 The unary * operator performs indirection: the expression to which it is
> applied shall be a pointer to an object type, or a pointer to a function
> type and the result is an lvalue referring to the object or function to
> which the expression points. If the type of the expression is “pointer to
> T”, the type of the result is “T”.»
>
> Should the last statement be written like
>
> «If the type of the expression is “pointer to T”, the type of the result is
> “T &”»?
It says it's an lvalue. Moreover, this wording is partially shared with the C
standard, which, on 6.5.3.2p4 for C99-C23, says:
"The unary * operator denotes indirection. If the operand points to a
function, the result is a function designator; if it points to an object, the
result is an lvalue designating the object. If the operand has type "pointer
to type", the result has type "type"."
via Std-Discussion wrote:
> «1 The unary * operator performs indirection: the expression to which it is
> applied shall be a pointer to an object type, or a pointer to a function
> type and the result is an lvalue referring to the object or function to
> which the expression points. If the type of the expression is “pointer to
> T”, the type of the result is “T”.»
>
> Should the last statement be written like
>
> «If the type of the expression is “pointer to T”, the type of the result is
> “T &”»?
It says it's an lvalue. Moreover, this wording is partially shared with the C
standard, which, on 6.5.3.2p4 for C99-C23, says:
"The unary * operator denotes indirection. If the operand points to a
function, the result is a function designator; if it points to an object, the
result is an lvalue designating the object. If the operand has type "pointer
to type", the result has type "type"."
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel DCAI Platform & System Engineering
Received on 2024-12-23 20:20:33