[ub] Draft 2 of Enhanced C/C++ memory and object model
David Vandevoorde
daveed at edg.com
Thu Mar 28 15:06:11 CET 2019
> On Mar 28, 2019, at 7:01 AM, Niall Douglas <s_sourceforge at nedprod.com> wrote:
>
>>> I wasn't aware there is a difference between pointer objects and pointer
>>> values. I had assumed (I am guessing incorrectly) that pointer objects
>>> are trivially copyable and thus can be stored in registers.
>>
>> An object has storage associated with it, a value not so.
>
> I was not aware that CPU registers are not storage in the C++ abstract
> machine. Fascinating.
It’s called the _abstract_ machine for a reason: It’s not connected to concrete CPUs per se.
> I assume that storage is defined as something whose address can be
> taken?
It’s a tad more abstract than that: Bit fields also occupy storage, but their address cannot be taken.
> Hence CPU registers don't count as storage?
CPU registers are simply not a “thing” in the abstract machine or the normative wording (though they’re mentioned in notes). They’re a means to an end in concrete implementations. So I’m not sure this question can be answered.
[…]
Daveed
More information about the ub
mailing list