C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Make all data pointers intercompatible

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Wed, 29 Jan 2025 13:50:23 +0000
On Wed, Jan 29, 2025 at 1:21 PM Sebastian Wittmeier wrote:
>
> Whenever this pointer is converted to (void*) its address is multiplied by 8 (leftshifted by 3).
>
> If (void*) is converted back to (double*) the address is divided by 8.
>
> The roundtrip from double* to void* to double* keeps the pointer value intact.
>
> But only, if it is aligned correctly.


You have a beautiful imagination Sebastian and I reckon you'd excel in
the world of theatrical entertainment. Let me know if you ever write a
stage play and I'll be front row centre.

Right now this second, looking at my watch here, it's 1:44pm on
Wednesday 29th January 2025, and all of the computers that had
different size data pointers are all long dead. If you were to find
one in an attic somewhere, you would probably need to solder out the
electrolytic capacitors before applying 240v AC to it. Not even the
microcontrollers nowadays have different size pointers.

Every computer alive today has pointers the same size. Continuing to
accommodate dead (or imaginary) computers in the C++ standard is just
needlessly complicating things.

Received on 2025-01-29 13:50:36