C++ (and C) strict aliasing rules include that a char*
and unsigned char*
may alias any other pointer.
AFAIK there is no analogous rule for uint8_t*
.
Thus my question: What are the aliasing rules for a std::byte
pointer?
The C++ reference currently just specifies:
Like the character types (char, unsigned char, signed char) it can be used to access raw memory occupied by other objects (object representation), but unlike those types, it is not a character type and is not an arithmetic type.
From the current Standard draft ([basic.types]/2):
So yes, the same aliasing rules apply for the three types, just as cppreference sums up.
It also might be valuable to mention ([basic.lval]/8.8):