Is `reinterpret_cast <char *> (reinterpret_cast <uintptr_t> (& ch) + 1) == & ch + 1` guaranteed?
I am writing alignment-dependent code and am completely surprised that there is no standard function test if the given pointer is correctly aligned.
It seems that most of the code on the Internet is used to (long)ptreither reinterpret_cast<uintptr_t>(ptr)check for alignment, and I also used them, but I am wondering if the cast pointer is compatible with the integral type as standard compatible.
Is there any system that makes this statement here?
char ch[2];
assert(reinterpret_cast<char*>(reinterpret_cast<uintptr_t>(&ch[0]) + 1)
== &ch[1]);
+4