boost::dynamic_bitset::shrink_to_fit

Requests the bitset to reduce memory use by removing unused capacity.

Synopsis

Declared in <boost/dynamic_bitset/dynamic_bitset.hpp>

void
shrink_to_fit();

Type requirements

If AllocatorOrContainer is a container, it provides capacity(), a member swap() and an allocator‐extended copy constructor.

Note

It does not change the size of the bitset, nor its allocator. If it reallocates, both the allocation of the new blocks and the deallocation of the old ones go through the allocator of the bitset.

Throws

An allocation error if memory is exhausted (std::bad_alloc if allocator_type is a std::allocator).

Created with MrDocs