bsl::bitset::bitset

Constructors

Synopses

Declared in <bslstl_bitset.h>

Create a bitset with all bits initialized to 0.

constexpr
bitset() noexcept;
» more...

Create a bitset from the low-order bits of the specified val.

constexpr
bitset(unsigned long long val) noexcept;
» more...

Create a bitset from characters in the specified str.

template<
    class CHAR_TYPE,
    class TRAITS,
    class ALLOCATOR>
explicit
bitset(
    bsl::basic_string<CHAR_TYPE, TRAITS, ALLOCATOR> const& str,
    bsl::basic_string<CHAR_TYPE, TRAITS, ALLOCATOR>::size_type pos = 0,
    bsl::basic_string<CHAR_TYPE, TRAITS, ALLOCATOR>::size_type n = bsl::basic_string<CHAR_TYPE, TRAITS, ALLOCATOR>::npos,
    CHAR_TYPE zeroChar = CHAR_TYPE('0'),
    CHAR_TYPE oneChar = CHAR_TYPE('1'));
» more...

Create a bitset from characters in the specified str.

template<
    class CHAR_TYPE,
    class TRAITS,
    class ALLOCATOR>
explicit
bitset(
    std::basic_string<CHAR_TYPE, TRAITS, ALLOCATOR> const& str,
    std::basic_string<CHAR_TYPE, TRAITS, ALLOCATOR>::size_type pos = 0,
    std::basic_string<CHAR_TYPE, TRAITS, ALLOCATOR>::size_type n = std::basic_string<CHAR_TYPE, TRAITS, ALLOCATOR>::npos,
    CHAR_TYPE zeroChar = CHAR_TYPE('0'),
    CHAR_TYPE oneChar = CHAR_TYPE('1'));
» more...

Parameters

NameDescription
valinteger whose bits initialize the low-order positions
strcharacter sequence providing bit values
posstarting index in str (default 0)
nmaximum number of characters to use (default npos)
zeroCharcharacter representing an unset bit (default '0')
oneCharcharacter representing a set bit (default '1')