boost::dynamic_bitset::dynamic_bitset :: Boost.DynamicBitset

# boost::dynamic_bitset::dynamic_bitset

Similar to the constructor from a pointer to a C‐style string, but takes a `std::basic_string_view`. This constructor is only available if DynamicBitset is compiled as C++17 or later.

## Synopsis

Declared in `<boost/dynamic_bitset/dynamic_bitset.hpp>`

    template<
        typename CharT,
        typename Traits>
    explicit
    dynamic_bitset(
        std::basic_string_view<CharT, Traits> sv,
        size_type num_bits = npos,
        allocator_type const& alloc = allocator_type());

## Parameters

Name | Description
--- | ---
sv | The basic_string_view to construct from.
num_bits | The size of the bitset to construct, if different from `npos`. (Otherwise the size of the bitset is `sv.length()`.)
alloc | The allocator to use.

## Preconditions

- The characters in `sv` that are use to initialize the bits compare equal to either `std::use_facet< std::ctype< CharT > >( std::locale() ).widen( '0' )` or `std::use_facet< std::ctype< CharT > >( std::locale() ).widen( '1' )`. E.g.: `dynamic_bitset<> b( std::string_view( "10xyz", 2 ) ); // OK`.

Created with MrDocs