Closed stertingen closed 1 year ago
Hi,
The existing implementation was UB. Compilers can use the unused alignment bits in the base class to store new members. This was reported as a bug (https://github.com/boostorg/container/issues/218) and the implementation changed with the newly released Boost 1.80. Could you please try your code with Boost 1.80?
Looks good: https://godbolt.org/z/Mx3cz1GnT (Showing Boost 1.79 vs. Boost 1.80)
Consider the following snippet: (https://godbolt.org/z/ax7TqGWTz)
I do not expect payload data to be overwritten by the header.
When having small_vector as data member instead of base class, the issue does not occur.
Is it illegal to derive from small_vector?