boost::from_block_range

Reads blocks from the iterator range into the bitset.

Synopsis

Declared in <boost/dynamic_bitset/dynamic_bitset.hpp>

template<
    typename BlockIterator,
    typename Block,
    typename AllocatorOrContainer>
void
from_block_range(
    BlockIterator first,
    BlockIterator last,
    dynamic_bitset<Block, AllocatorOrContainer>& result);

Description

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

Throws

Any exception thrown by an operation of BlockIterator. In that case, result keeps its size, but some of its blocks may have been overwritten.

Parameters

Name

Description

first

The start of the range.

last

The end of the range.

result

The resulting bitset.

Preconditions

  • The type BlockIterator 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). The size of the iterator range must be less than or equal to b.num_blocks(). Excess bits are not copied into the bitset, which doesn't change its size.

Created with MrDocs