This is an obvious mistake. Criminal is this diff that changed this line to capacity()
return (index_size ? (index_size - ExtraPointers + extra_capacity) : index_size);
to
const size_type index_offset = (ExtraPointers + extra_capacity) & (size_type(0u) - size_type(index_size != 0)); return index_size - index_offset;
which was intended as "optimization" , presumably avoiding the branch.
Unfortunately, two blocks of code are not equivalent. The second option is actually equivalent
return (index_size ? (index_size - (ExtraPointers + extra_capacity)) : index_size);
So, instead of adding extra_capacity (which is 10 in your case), it subtracts it.
The bug was fixed in the boot of Boost.Container, and the fix should be in the next version of Boost.
TC
source share