[#bsl-bitset-2constructor-07] = xref:bsl.adoc[bsl]::xref:bsl/bitset.adoc[bitset]::bitset :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_bitset.h>` Create a `bitset` with all bits initialized to `0`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr xref:bsl/bitset/2constructor-09.adoc[bitset]() noexcept; ---- [.small]#xref:bsl/bitset/2constructor-09.adoc[_» more..._]# Create a bitset from the low‐order bits of the specified `val`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr xref:bsl/bitset/2constructor-08b.adoc[bitset](unsigned long long val) noexcept; ---- [.small]#xref:bsl/bitset/2constructor-08b.adoc[_» more..._]# Create a bitset from characters in the specified `str`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class TRAITS, class ALLOCATOR> explicit xref:bsl/bitset/2constructor-08f.adoc[bitset]( xref:bsl/basic_string-0faf.adoc[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')); ---- [.small]#xref:bsl/bitset/2constructor-08f.adoc[_» more..._]# Create a bitset from characters in the specified `str`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class TRAITS, class ALLOCATOR> explicit xref:bsl/bitset/2constructor-03.adoc[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')); ---- [.small]#xref:bsl/bitset/2constructor-03.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *val* | integer whose bits initialize the low‐order positions | *str* | character sequence providing bit values | *pos* | starting index in `str` (default 0) | *n* | maximum number of characters to use (default npos) | *zeroChar* | character representing an unset bit (default '0') | *oneChar* | character representing a set bit (default '1') |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#