Constructors
Synopses
Declared in <bslstl_bitset.h>
Create a bitset with all bits initialized to 0.
constexpr
bitset() noexcept;
Create a bitset with its first M bit positions correspond to bit values in the specified val. M is the smaller of the parameterized N and 8 * sizeof(unsigned long long). If M < N, the remaining bit positions are initialized to 0.
constexpr
bitset(unsigned long long val) noexcept;
Create a bitset with its first M bit positions corresponding to the characters in the specified pos of the specified str. M is the smaller of the parameterized N and str.length(). If M < N, the remaining bit positions are initialized to 0. Characters with the value zeroChar correspond to an unset bit and characters with the value oneChar correspond to a set bit. The behavior is undefined if the characters in the specified str is not the specified zeroChar and not the specified oneChar.
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'));
Create a bitset with its first M bit positions corresponding to the characters in the specified pos of the specified str. M is the smaller of the parameterized N and str.length(). If M < N, the remaining bit positions are initialized to 0. Characters with the value zeroChar correspond to an unset bit and characters with the value oneChar correspond to a set bit. The behavior is undefined if any characters in str is neither the specified zeroChar nor the specified oneChar.
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'));
Created with MrDocs