boost::dynamic_bitset::dynamic_bitset

Constructs a bitset of num_bits bits, all zero.

Synopsis

Declared in <boost/dynamic_bitset/dynamic_bitset.hpp>

explicit
dynamic_bitset(size_type num_bits);

Description

This constructor is explicit, so, e.g., neither dynamic_bitset<> b = 8; nor dynamic_bitset<> b = { 8 }; compiles. The constructor from a size and a value, instead, isn't explicit (see below).

Throws

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

Parameters

Name

Description

num_bits

The size of the constructed bitset.

Postconditions

  • ‐ this‐>size() == num_bits ‐ For all i in the range [0, num_bits)], `( *this )[ i ] == false`.

Created with MrDocs