I've searched through the standard about unaligned access, but didn't find anything (maybe I was inadvertent).
Is it undefined behavior? Is it implementation defined?
As a lot of current CPUs support unaligned access, it would be sensible that unaligned memory access is implementation defined. Is it the case?
By unaligned access, I mean for example:
alignas(int) char buffer[sizeof(int)+1];
int &x = *new(buffer+1) int;
x = 42;
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…