C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] Proposal - Allow '.' operator to work on pointers (again sortof)

From: Jens Gustedt <jens.gustedt_at_[hidden]>
Date: Tue, 10 Mar 2020 08:42:44 +0100
J,

on Tue, 10 Mar 2020 00:21:52 -0700 you (J Decker via Liaison
<liaison_at_[hidden]>) wrote:

> I might again stress, in a different way, it's about the member in the
> object, not the whole object.

That is the intent, yes, but not the effect.

(*p).member

has `*p` in it, which is an "evaluation" of the object as a whole. In
a non-optimized compilation, this may trigger the load of
uninitialized pointer members, for example.

In the Memory Model SG we are trying to put our hands on this kind of
stuff, and for the moment there are as many opinions as are people
involved how and when the effective type rule ensures that such a
pointed-to object acquires the type. Doing it with → is easy, doing it
with (*). is a headache.

Thanks
Jens

-- 
:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Received on 2020-03-10 02:45:33