C++ Logo

std-discussion

Advanced search

The type of an expression with the indirection operator *

From: Vladimir Grigoriev <vlad.moscow_at_[hidden]>
Date: Mon, 23 Dec 2024 23:05:07 +0300
In the C++20 Standard in the section 7.6.2.2 «Unary operators» there is written
 
«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 &”»?
 
With best regards,
Vlad from Moscow
You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com

Received on 2024-12-23 20:05:25