Subject: Re: reading values as bytes without memcpu, from enum unsigned char?
Date: 2020-08-07 09:06:38
On 07/08/2020 16:51, Jason McKesson via Std-Discussion wrote:
> The cast is legal. Accessing the `unsigned char` at that address is
You can't access `unsigned char` objects, `reinterpret_cast<unsigned char*>(buf)` points to the object of `mybyte` type.
But accessing an object of `mybyte` type through a glvalue of `unsigned char` type is indeed legal, because an enumeration with a fixed underlying type has the same values as the underlying type.
STD-DISCUSSION list run by email@example.com
Older Archives on Google Groups