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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…