
On 5 Sep 2025 23:01, Joaquín M López Muñoz wrote:
No dia 5 de set. de 2025, às 21:51, Andrey Semashev via Boost <boost@lists.boost.org> escreveu:
On 5 Sep 2025 20:22, Gennaro Prota wrote:
On 9/5/2025 5:47 PM, Andrey Semashev via Boost wrote:
One downside with the "allocator or container" approach is that you would have to duplicate the size of the container. The embedded container will maintain its size as the number of words, but the last word in the bitset may be incomplete, so the bitset will have to have a size of its own.
That was already the case. So far, dynamic_bitset used a std::vector< Block, Allocator >. Now, it will either use that or the provided container type.
This is unfortunate. I wish this was optimized as well.
What kind of optimization do you have in mind? I don’t think using std::vector as the backend can really introduce any performance penalty.
If dynamic_bitset managed storage by itself, it could track only the number of bits in the container and derive the number of words from it. This would reduce the size of the container object. Yes, this would be incompatible with the "allocator or container" approach, but it would be more optimal.