Subject: Re: [std-proposals] Allowing access to object representations
From: Jake Arkinstall (jake.arkinstall_at_[hidden])
Date: 2019-08-21 19:16:24
On Thu, 22 Aug 2019, 00:38 sdkrystian via Std-Proposals, <
> > It's nothing to do with the value of the int object as a whole, but of
> the leftmost byte. Why on earth would it *not* depend on endianness?
> Because the standard says so. Here are some citations:
> In that particular cast, the value of the pointer is unchanged.
> Since the value is unchanged, it still points to the int object.
It does. But the char pointer points to the first byte. Which is platform
Therefore, when the indirection operator is used, it yields an lvalue of
> type `char` that denotes the object the pointer points to.
Which is a char. At this point, the source object being an int is not
relevant (or known, in the case of static compiled libraries that expect a
char). Otherwise reinterpret cast is completely redundant for any practical
STD-PROPOSALS list run by firstname.lastname@example.org
Standard Proposals Archives on Google Groups