I would prefer to eliminate the inlined_storage.h header from util, since we are adding a more general inline_allocator.h and discoverability will be reduced with two similar components.
inlined_storage has got features that are specific to dynamic bitset and doesn't really need to be in a header that indicates general purpose application.
e.g.:
Terminology of "block type" is really an element type, but in the context of dynamic bitset, it is a block of bits.
The `kBlockSize` is a bit count (useful only for dynamic bitset). It's just CHAR_BIT times the `sizeof(BT)`.
It requires trivial `BT` (block type). Containers shouldn't need this.
Some needed improvements incidentally, with it:
move operations need to be noexcept
Set of comparison operators are incomplete and should be friend inline defs.
ostream operator<< are not usually defined for generic containers, but this has one. The blocks stored by a dynamic bitset are not values so it's unclear what the significance of its streamified form should be. This operation should only happen at a higher, specific, layer.
The "allOf" and "anyOf" friend functions should be removed. Element iterators and the standard std::any_of and std::all_of should be able to handle this. These operations are not necessary for an inline storage class, but they are used to build operations for dynamic_bitset, so they should be defined there.
- is related to
-
SERVER-82176 Implement effective dynamic bitset for the boolean simplifier
- Closed
- related to
-
SERVER-88562 Create a linked-list container with a small element optimization
- Closed
-
SERVER-88771 Upgrade our macOS toolchain
- Closed