boost::dynamic_bitset::append

Appends a range of blocks to *this.

Synopsis

Declared in <boost/dynamic_bitset/dynamic_bitset.hpp>

template<typename BlockInputIterator>
void
append(
    BlockInputIterator first,
    BlockInputIterator last);

Description

This member provides the same end result as the following code, but is typically more efficient.

for (; first != last; ++first) {
    append( *first );
}

So, each element of the range is converted to Block, and makes a whole block, as with the constructor from a range of blocks.

Throws

An allocation error if memory is exhausted (std::bad_alloc if allocator_type is a std::allocator), or any exception thrown by an operation of BlockInputIterator. If an exception is thrown, *this is left unchanged, except that its capacity may have increased.

Parameters

Name

Description

first

The start of the range.

last

The end of the range.

Preconditions

  • The BlockInputIterator type must be a model of LegacyInputIterator and its value_type must be implicitly convertible to Block and be neither bool nor a floating‐point type (a static_assert checks this).

Created with MrDocs