Do we need to use std::launder when doing pointer arithmetic within a standard-layout object (e.g., with offsetof)?
问题 This question is a follow-up to: Is adding to a "char *" pointer UB, when it doesn't actually point to a char array? In CWG 1314, CWG affirmed that it is legal to perform pointer arithmetic within a standard-layout object using an unsigned char pointer. This would appear to imply that some code similar to that in the linked question should work as intended: struct Foo { float x, y, z; }; Foo f; unsigned char *p = reinterpret_cast<unsigned char*>(&f) + offsetof(Foo, z); // (*) *reinterpret