Hi Jonathan,
the value of the underlying bytes matter.
Currently the C++ standard (AFAIK) does not specify, how pointers are represented in memory.
There are only certain high-level guarantees, e.g.
&p[i] = p + i
or that increment/decrement can access the next/previous element.
Internally the small string optimization of the implementation(s) use the same pointer member variable for a heap pointer or for pointing to the SSO buffer.
When relocating the object, this has to be tested, and the pointer value should only be changed, if it points to the internal buffer.
If we do not assume a certain underlying pointer representation, we cannot know, whether a pointer to std::byte and a pointer to char32_t has the same representation and we can just use the unaligned beginning of the buffer as marker, as we did in the original class.
Probably the string class is an non-optimal example:
Whoever creates the unaligned relocation should be the implementer of the standard library implementation or even the basic_string class itself, as private class internals are accessed and modified.
They can just always use a byte-pointer anyway or make platform-dependent assumptions about the underlying representation
It is possible to keep the char32_t pointer and use std::align to generate an internal aligned pointer without any assumptions about representation.
So if one would bring up the example in the proposal, it should not put additional non-necessary demands into the language.
Thomas/Frederick asked about making all pointer types the same size and representation (and probably set the representation) and make them some sort of 'intercompatible'.