This post had me really confused on the libcxx implementation, since the bit of small.is_large would be sharing storage with large.capacity, which wouldn’t necessarily match up. In the actual code__is_long_ is allocated in both the short and long structs of the union, so that’s that mystery solved.
Excellent comparison, it looks like no implementation wins on all operations.
The author provides optimizations for the libc++ implementation, stellar work as always for Raymond Chen.
This post had me really confused on the libcxx implementation, since the bit of
small.is_largewould be sharing storage withlarge.capacity, which wouldn’t necessarily match up. In the actual code__is_long_is allocated in both the short and long structs of the union, so that’s that mystery solved.