C++ Logo

std-proposals

Advanced search

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

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Fri, 31 Jan 2025 11:57:12 +0000
On Fri, Jan 31, 2025 at 9:24 AM Jonathan Wakely wrote:
>
> If the object isn't accessed while in unaligned memory, why does
> the value of the underlying bytes of that pointer matter in the slightest?
> They're just bytes, not a pointer value, aren't they?



Purely as a hypothetical, if sizeof(char32_t*) < sizeof(void*), then
the pointer might not have enough bits to store the address of an
unaligned byte.

Of course this will never happen -- but the C++ Standard accommodates it.

Received on 2025-01-31 11:57:23