.TH "std::bitset< _Nb >" 3cxx "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::bitset< _Nb > \- The bitset class represents a \fIfixed-size\fP sequence of bits\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBstd::_Base_bitset<((_Nb)/(__CHAR_BIT__ *__SIZEOF_LONG__)+((_Nb) %(__CHAR_BIT__ *__SIZEOF_LONG__)==0 ? 0 :1))>\fP\&. .SS "Classes" .in +1c .ti -1c .RI "class \fBreference\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBconstexpr\fP \fBbitset\fP () \fBnoexcept\fP" .br .RI "All bits set to zero\&. " .ti -1c .RI "template<\fBtypename\fP _CharT > \fBbitset\fP (\fBconst\fP _CharT *\fB__str\fP, \fBtypename\fP \fBstd::basic_string\fP< _CharT >::size_type __n=\fBstd::basic_string\fP< _CharT >::npos, _CharT \fB__zero\fP=_CharT('0'), _CharT \fB__one\fP=_CharT('1'))" .br .ti -1c .RI "template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBbitset\fP (\fBconst\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > &\fB__s\fP, size_t \fB__position\fP, size_t __n)" .br .ti -1c .RI "template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBbitset\fP (\fBconst\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > &\fB__s\fP, size_t \fB__position\fP, size_t __n, _CharT \fB__zero\fP, _CharT \fB__one\fP=_CharT('1'))" .br .ti -1c .RI "template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBbitset\fP (\fBconst\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > &\fB__s\fP, size_t \fB__position\fP=0)" .br .ti -1c .RI "\fBconstexpr\fP \fBbitset\fP (unsigned long long __val) \fBnoexcept\fP" .br .RI "Initial bits bitwise-copied from a single word (others set to zero)\&. " .ti -1c .RI "size_t \fB_Find_first\fP () \fBconst\fP \fBnoexcept\fP" .br .RI "Finds the index of the first 'on' bit\&. " .ti -1c .RI "size_t \fB_Find_next\fP (size_t \fB__prev\fP) \fBconst\fP \fBnoexcept\fP" .br .RI "Finds the index of the next 'on' bit after prev\&. " .ti -1c .RI "template<\fBclass\fP _CharT , \fBclass\fP _Traits > \fBvoid\fP \fB_M_copy_from_ptr\fP (\fBconst\fP _CharT *, size_t, size_t, size_t, _CharT, _CharT)" .br .ti -1c .RI "template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBvoid\fP \fB_M_copy_from_string\fP (\fBconst\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > &\fB__s\fP, size_t \fB__pos\fP, size_t __n)" .br .ti -1c .RI "template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBvoid\fP \fB_M_copy_from_string\fP (\fBconst\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > &\fB__s\fP, size_t \fB__pos\fP, size_t __n, _CharT \fB__zero\fP, _CharT \fB__one\fP)" .br .ti -1c .RI "template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBvoid\fP \fB_M_copy_to_string\fP (\fBstd::basic_string\fP< _CharT, _Traits, _Alloc > &, _CharT, _CharT) \fBconst\fP" .br .ti -1c .RI "template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBvoid\fP \fB_M_copy_to_string\fP (\fBstd::basic_string\fP< _CharT, _Traits, _Alloc > &\fB__s\fP) \fBconst\fP" .br .ti -1c .RI "bool \fBall\fP () \fBconst\fP \fBnoexcept\fP" .br .RI "Tests whether all the bits are on\&. " .ti -1c .RI "bool \fBany\fP () \fBconst\fP \fBnoexcept\fP" .br .RI "Tests whether any of the bits are on\&. " .ti -1c .RI "size_t \fBcount\fP () \fBconst\fP \fBnoexcept\fP" .br .RI "Returns the number of bits which are set\&. " .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fBflip\fP () \fBnoexcept\fP" .br .RI "Toggles every bit to its opposite value\&. " .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fBflip\fP (size_t \fB__position\fP)" .br .RI "Toggles a given bit to its opposite value\&. " .ti -1c .RI "bool \fBnone\fP () \fBconst\fP \fBnoexcept\fP" .br .RI "Tests whether any of the bits are on\&. " .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > \fBoperator~\fP () \fBconst\fP \fBnoexcept\fP" .br .RI "See the no-argument flip()\&. " .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fBreset\fP () \fBnoexcept\fP" .br .RI "Sets every bit to false\&. " .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fBreset\fP (size_t \fB__position\fP)" .br .RI "Sets a given bit to false\&. " .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fBset\fP () \fBnoexcept\fP" .br .RI "Sets every bit to true\&. " .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fBset\fP (size_t \fB__position\fP, bool __val=\fBtrue\fP)" .br .RI "Sets a given bit to a particular value\&. " .ti -1c .RI "\fBconstexpr\fP size_t \fBsize\fP () \fBconst\fP \fBnoexcept\fP" .br .RI "Returns the total number of bits\&. " .ti -1c .RI "bool \fBtest\fP (size_t \fB__position\fP) \fBconst\fP" .br .RI "Tests the value of a bit\&. " .ti -1c .RI "template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > \fBto_string\fP () \fBconst\fP" .br .RI "Returns a character interpretation of the bitset\&. " .ti -1c .RI "template<\fBclass\fP _CharT , \fBclass\fP _Traits > \fBstd::basic_string\fP< _CharT, _Traits, \fBstd::allocator\fP< _CharT > > \fBto_string\fP () \fBconst\fP" .br .ti -1c .RI "template<\fBclass\fP _CharT > \fBstd::basic_string\fP< _CharT, \fBstd::char_traits\fP< _CharT >, \fBstd::allocator\fP< _CharT > > \fBto_string\fP () \fBconst\fP" .br .ti -1c .RI "\fBstd::basic_string\fP< char, \fBstd::char_traits\fP< char >, \fBstd::allocator\fP< char > > \fBto_string\fP () \fBconst\fP" .br .ti -1c .RI "template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > \fBto_string\fP (_CharT \fB__zero\fP, _CharT \fB__one\fP=_CharT('1')) \fBconst\fP" .br .ti -1c .RI "template<\fBclass\fP _CharT , \fBclass\fP _Traits > \fBstd::basic_string\fP< _CharT, _Traits, \fBstd::allocator\fP< _CharT > > \fBto_string\fP (_CharT \fB__zero\fP, _CharT \fB__one\fP=_CharT('1')) \fBconst\fP" .br .ti -1c .RI "template<\fBclass\fP _CharT > \fBstd::basic_string\fP< _CharT, \fBstd::char_traits\fP< _CharT >, \fBstd::allocator\fP< _CharT > > \fBto_string\fP (_CharT \fB__zero\fP, _CharT \fB__one\fP=_CharT('1')) \fBconst\fP" .br .ti -1c .RI "\fBstd::basic_string\fP< char, \fBstd::char_traits\fP< char >, \fBstd::allocator\fP< char > > \fBto_string\fP (char \fB__zero\fP, char \fB__one\fP='1') \fBconst\fP" .br .ti -1c .RI "unsigned long long \fBto_ullong\fP () \fBconst\fP" .br .ti -1c .RI "unsigned long \fBto_ulong\fP () \fBconst\fP" .br .RI "Returns a numerical interpretation of the bitset\&. " .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fBoperator&=\fP (\fBconst\fP \fBbitset\fP< \fB_Nb\fP > &\fB__rhs\fP) \fBnoexcept\fP" .br .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fBoperator|=\fP (\fBconst\fP \fBbitset\fP< \fB_Nb\fP > &\fB__rhs\fP) \fBnoexcept\fP" .br .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fBoperator^=\fP (\fBconst\fP \fBbitset\fP< \fB_Nb\fP > &\fB__rhs\fP) \fBnoexcept\fP" .br .in -1c .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fBoperator<<=\fP (size_t \fB__position\fP) \fBnoexcept\fP" .br .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fBoperator>>=\fP (size_t \fB__position\fP) \fBnoexcept\fP" .br .in -1c .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fB_Unchecked_set\fP (size_t \fB__pos\fP) \fBnoexcept\fP" .br .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fB_Unchecked_set\fP (size_t \fB__pos\fP, int __val) \fBnoexcept\fP" .br .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fB_Unchecked_reset\fP (size_t \fB__pos\fP) \fBnoexcept\fP" .br .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > & \fB_Unchecked_flip\fP (size_t \fB__pos\fP) \fBnoexcept\fP" .br .ti -1c .RI "\fBconstexpr\fP bool \fB_Unchecked_test\fP (size_t \fB__pos\fP) \fBconst\fP \fBnoexcept\fP" .br .in -1c .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "\fBreference\fP \fBoperator[]\fP (size_t \fB__position\fP)" .br .RI "Array-indexing support\&. " .ti -1c .RI "\fBconstexpr\fP bool \fBoperator[]\fP (size_t \fB__position\fP) \fBconst\fP" .br .RI "Array-indexing support\&. " .in -1c .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "bool \fBoperator==\fP (\fBconst\fP \fBbitset\fP< \fB_Nb\fP > &\fB__rhs\fP) \fBconst\fP \fBnoexcept\fP" .br .RI "These comparisons for equality/inequality are, well, \fIbitwise\fP\&. " .ti -1c .RI "bool \fBoperator!=\fP (\fBconst\fP \fBbitset\fP< \fB_Nb\fP > &\fB__rhs\fP) \fBconst\fP \fBnoexcept\fP" .br .RI "These comparisons for equality/inequality are, well, \fIbitwise\fP\&. " .in -1c .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > \fBoperator<<\fP (size_t \fB__position\fP) \fBconst\fP \fBnoexcept\fP" .br .RI "Self-explanatory\&. " .ti -1c .RI "\fBbitset\fP< \fB_Nb\fP > \fBoperator>>\fP (size_t \fB__position\fP) \fBconst\fP \fBnoexcept\fP" .br .RI "Self-explanatory\&. " .in -1c .in -1c .SS "Friends" .in +1c .ti -1c .RI "\fBclass\fP \fBreference\fP" .br .ti -1c .RI "\fBstruct\fP \fBstd::hash< bitset >\fP" .br .in -1c .SH "Detailed Description" .PP .SS "template .br class std::bitset< _Nb >"The bitset class represents a \fIfixed-size\fP sequence of bits\&. (Note that bitset does \fInot\fP meet the formal requirements of a \fCcontainer\fP\&. Mainly, it lacks iterators\&.) .PP The template argument, \fINb\fP, may be any non-negative number, specifying the number of bits (e\&.g\&., '0', '12', '1024*1024')\&. .PP In the general unoptimized case, storage is allocated in word-sized blocks\&. Let B be the number of bits in a word, then (Nb+(B-1))/B words will be used for storage\&. B - NbB bits are unused\&. (They are the high-order bits in the highest word\&.) It is a class invariant that those unused bits are always zero\&. .PP If you think of bitset as \fIa simple array of bits\fP, be aware that your mental picture is reversed: a bitset behaves the same way as bits in integers do, with the bit at index 0 in the \fIleast significant / right-hand\fP position, and the bit at index Nb-1 in the \fImost significant / left-hand\fP position\&. Thus, unlike other containers, a bitset's index \fIcounts from right to left\fP, to put it very loosely\&. .PP This behavior is preserved when translating to and from strings\&. For example, the first line of the following program probably prints \fIb('a') is 0001100001\fP on a modern ASCII system\&. .PP .PP .nf #include #include #include using namespace std; int main() { long a = 'a'; bitset<10> b(a); cout << "b('a') is " << b << endl; ostringstream s; s << b; string str = s\&.str(); cout << "index 3 in the string is " << str[3] << " but\\n" << "index 3 in the bitset is " << b[3] << endl; } .fi .PP .PP Also see: https://gcc.gnu.org/onlinedocs/libstdc++/manual/ext_containers.html for a description of extensions\&. .PP Most of the actual code isn't contained in bitset<> itself, but in the base class _Base_bitset\&. The base class works with whole words, not with individual bits\&. This allows us to specialize _Base_bitset for the important special case where the bitset is only a single word\&. .PP Extra confusion can result due to the fact that the storage for _Base_bitset \fIis\fP a regular array, and is indexed as such\&. This is carefully encapsulated\&. .PP Definition at line \fB751\fP of file \fBbitset\fP\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fBconstexpr\fP \fBstd::bitset\fP< \fB_Nb\fP >::bitset ()\fC [inline]\fP, \fC [constexpr]\fP, \fC [noexcept]\fP" .PP All bits set to zero\&. .PP Definition at line \fB869\fP of file \fBbitset\fP\&. .SS "template \fBconstexpr\fP \fBstd::bitset\fP< \fB_Nb\fP >::bitset (unsigned long long __val)\fC [inline]\fP, \fC [constexpr]\fP, \fC [noexcept]\fP" .PP Initial bits bitwise-copied from a single word (others set to zero)\&. .PP Definition at line \fB874\fP of file \fBbitset\fP\&. .SS "template template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBstd::bitset\fP< \fB_Nb\fP >::bitset (\fBconst\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > & __s, size_t __position = \fC0\fP)\fC [inline]\fP, \fC [explicit]\fP" Use a subset of a string\&. .PP \fBParameters\fP .RS 4 \fI__s\fP A string of \fI0\fP and \fI1\fP characters\&. .br \fI__position\fP Index of the first character in \fI__s\fP to use; defaults to zero\&. .RE .PP \fBExceptions\fP .RS 4 \fIstd::out_of_range\fP If \fIpos\fP is bigger the size of \fI__s\fP\&. .br \fIstd::invalid_argument\fP If a character appears in the string which is neither \fI0\fP nor \fI1\fP\&. .RE .PP .PP Definition at line \fB893\fP of file \fBbitset\fP\&. .SS "template template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBstd::bitset\fP< \fB_Nb\fP >::bitset (\fBconst\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > & __s, size_t __position, size_t __n)\fC [inline]\fP" Use a subset of a string\&. .PP \fBParameters\fP .RS 4 \fI__s\fP A string of \fI0\fP and \fI1\fP characters\&. .br \fI__position\fP Index of the first character in \fI__s\fP to use\&. .br \fI__n\fP The number of characters to copy\&. .RE .PP \fBExceptions\fP .RS 4 \fIstd::out_of_range\fP If \fI__position\fP is bigger the size of \fI__s\fP\&. .br \fIstd::invalid_argument\fP If a character appears in the string which is neither \fI0\fP nor \fI1\fP\&. .RE .PP .PP Definition at line \fB914\fP of file \fBbitset\fP\&. .SS "template template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBstd::bitset\fP< \fB_Nb\fP >::bitset (\fBconst\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > & __s, size_t __position, size_t __n, _CharT __zero, _CharT __one = \fC_CharT('1')\fP)\fC [inline]\fP" .PP Definition at line \fB925\fP of file \fBbitset\fP\&. .SS "template template<\fBtypename\fP _CharT > \fBstd::bitset\fP< \fB_Nb\fP >::bitset (\fBconst\fP _CharT * __str, \fBtypename\fP \fBstd::basic_string\fP< _CharT >::size_type __n = \fC\fBstd::basic_string\fP<_CharT>::npos\fP, _CharT __zero = \fC_CharT('0')\fP, _CharT __one = \fC_CharT('1')\fP)\fC [inline]\fP, \fC [explicit]\fP" Construct from a character array\&. .PP \fBParameters\fP .RS 4 \fI__str\fP An array of characters \fIzero\fP and \fIone\fP\&. .br \fI__n\fP The number of characters to use\&. .br \fI__zero\fP The character corresponding to the value 0\&. .br \fI__one\fP The character corresponding to the value 1\&. .RE .PP \fBExceptions\fP .RS 4 \fIstd::invalid_argument\fP If a character appears in the string which is neither \fI__zero\fP nor \fI__one\fP\&. .RE .PP .PP Definition at line \fB946\fP of file \fBbitset\fP\&. .SH "Member Function Documentation" .PP .SS "template template<\fBclass\fP _CharT , \fBclass\fP _Traits > \fBvoid\fP bitset::_M_copy_from_ptr (\fBconst\fP _CharT * __s, size_t __len, size_t __pos, size_t __n, _CharT __zero, _CharT __one)" .PP Definition at line \fB1390\fP of file \fBbitset\fP\&. .SS "template template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBvoid\fP \fBstd::bitset\fP< \fB_Nb\fP >::_M_copy_from_string (\fBconst\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > & __s, size_t __pos, size_t __n)\fC [inline]\fP" .PP Definition at line \fB1284\fP of file \fBbitset\fP\&. .SS "template template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBvoid\fP \fBstd::bitset\fP< \fB_Nb\fP >::_M_copy_from_string (\fBconst\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > & __s, size_t __pos, size_t __n, _CharT __zero, _CharT __one)\fC [inline]\fP" .PP Definition at line \fB1270\fP of file \fBbitset\fP\&. .SS "template template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBvoid\fP bitset::_M_copy_to_string (\fBstd::basic_string\fP< _CharT, _Traits, _Alloc > & __s, _CharT __zero, _CharT __one) const" .PP Definition at line \fB1411\fP of file \fBbitset\fP\&. .SS "template template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBvoid\fP \fBstd::bitset\fP< \fB_Nb\fP >::_M_copy_to_string (\fBstd::basic_string\fP< _CharT, _Traits, _Alloc > & __s) const\fC [inline]\fP" .PP Definition at line \fB1290\fP of file \fBbitset\fP\&. .SS "template bool \fBstd::bitset\fP< \fB_Nb\fP >::all () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Tests whether all the bits are on\&. .PP \fBReturns\fP .RS 4 True if all the bits are set\&. .RE .PP .PP Definition at line \fB1334\fP of file \fBbitset\fP\&. .SS "template bool \fBstd::bitset\fP< \fB_Nb\fP >::any () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Tests whether any of the bits are on\&. .PP \fBReturns\fP .RS 4 True if at least one bit is set\&. .RE .PP .PP Definition at line \fB1342\fP of file \fBbitset\fP\&. .SS "template size_t \fBstd::bitset\fP< \fB_Nb\fP >::count () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Returns the number of bits which are set\&. .PP Definition at line \fB1295\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > & \fBstd::bitset\fP< \fB_Nb\fP >::flip ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Toggles every bit to its opposite value\&. .PP Definition at line \fB1123\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > & \fBstd::bitset\fP< \fB_Nb\fP >::flip (size_t __position)\fC [inline]\fP" .PP Toggles a given bit to its opposite value\&. .PP \fBParameters\fP .RS 4 \fI__position\fP The index of the bit\&. .RE .PP \fBExceptions\fP .RS 4 \fIstd::out_of_range\fP If \fIpos\fP is bigger the size of the set\&. .RE .PP .PP Definition at line \fB1136\fP of file \fBbitset\fP\&. .SS "template bool \fBstd::bitset\fP< \fB_Nb\fP >::none () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Tests whether any of the bits are on\&. .PP \fBReturns\fP .RS 4 True if none of the bits are set\&. .RE .PP .PP Definition at line \fB1350\fP of file \fBbitset\fP\&. .SS "template bool \fBstd::bitset\fP< \fB_Nb\fP >::operator!= (\fBconst\fP \fBbitset\fP< \fB_Nb\fP > & __rhs) const\fC [inline]\fP, \fC [noexcept]\fP" .PP These comparisons for equality/inequality are, well, \fIbitwise\fP\&. .PP Definition at line \fB1310\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > & \fBstd::bitset\fP< \fB_Nb\fP >::operator&= (\fBconst\fP \fBbitset\fP< \fB_Nb\fP > & __rhs)\fC [inline]\fP, \fC [noexcept]\fP" Operations on bitsets\&. .PP \fBParameters\fP .RS 4 \fI__rhs\fP A same-sized bitset\&. .RE .PP These should be self-explanatory\&. .PP Definition at line \fB972\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > \fBstd::bitset\fP< \fB_Nb\fP >::operator<< (size_t __position) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Self-explanatory\&. .PP Definition at line \fB1350\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > & \fBstd::bitset\fP< \fB_Nb\fP >::operator<<= (size_t __position)\fC [inline]\fP, \fC [noexcept]\fP" Operations on bitsets\&. .PP \fBParameters\fP .RS 4 \fI__position\fP The number of places to shift\&. .RE .PP These should be self-explanatory\&. .PP Definition at line \fB986\fP of file \fBbitset\fP\&. .SS "template bool \fBstd::bitset\fP< \fB_Nb\fP >::operator== (\fBconst\fP \fBbitset\fP< \fB_Nb\fP > & __rhs) const\fC [inline]\fP, \fC [noexcept]\fP" .PP These comparisons for equality/inequality are, well, \fIbitwise\fP\&. .PP Definition at line \fB1306\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > \fBstd::bitset\fP< \fB_Nb\fP >::operator>> (size_t __position) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Self-explanatory\&. .PP Definition at line \fB1360\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > & \fBstd::bitset\fP< \fB_Nb\fP >::operator>>= (size_t __position)\fC [inline]\fP, \fC [noexcept]\fP" Operations on bitsets\&. .PP \fBParameters\fP .RS 4 \fI__position\fP The number of places to shift\&. .RE .PP These should be self-explanatory\&. .PP Definition at line \fB1014\fP of file \fBbitset\fP\&. .SS "template \fBreference\fP \fBstd::bitset\fP< \fB_Nb\fP >::operator[] (size_t __position)\fC [inline]\fP" .PP Array-indexing support\&. .PP \fBParameters\fP .RS 4 \fI__position\fP Index into the bitset\&. .RE .PP \fBReturns\fP .RS 4 A bool for a \fIconst bitset\fP\&. For non-const bitsets, an instance of the reference proxy class\&. .RE .PP \fBNote\fP .RS 4 These operators do no range checking and throw no exceptions, as required by DR 11 to the standard\&. .RE .PP _GLIBCXX_RESOLVE_LIB_DEFECTS Note that this implementation already resolves DR 11 (items 1 and 2), but does not do the range-checking required by that DR's resolution\&. -pme The DR has since been changed: range-checking is a precondition (users' responsibility), and these functions must not throw\&. -pme .PP Definition at line \fB1163\fP of file \fBbitset\fP\&. .SS "template \fBconstexpr\fP bool \fBstd::bitset\fP< \fB_Nb\fP >::operator[] (size_t __position) const\fC [inline]\fP, \fC [constexpr]\fP" .PP Array-indexing support\&. .PP \fBParameters\fP .RS 4 \fI__position\fP Index into the bitset\&. .RE .PP \fBReturns\fP .RS 4 A bool for a \fIconst bitset\fP\&. For non-const bitsets, an instance of the reference proxy class\&. .RE .PP \fBNote\fP .RS 4 These operators do no range checking and throw no exceptions, as required by DR 11 to the standard\&. .RE .PP _GLIBCXX_RESOLVE_LIB_DEFECTS Note that this implementation already resolves DR 11 (items 1 and 2), but does not do the range-checking required by that DR's resolution\&. -pme The DR has since been changed: range-checking is a precondition (users' responsibility), and these functions must not throw\&. -pme .PP Definition at line \fB1167\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > & \fBstd::bitset\fP< \fB_Nb\fP >::operator^= (\fBconst\fP \fBbitset\fP< \fB_Nb\fP > & __rhs)\fC [inline]\fP, \fC [noexcept]\fP" Operations on bitsets\&. .PP \fBParameters\fP .RS 4 \fI__rhs\fP A same-sized bitset\&. .RE .PP These should be self-explanatory\&. .PP Definition at line \fB986\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > & \fBstd::bitset\fP< \fB_Nb\fP >::operator|= (\fBconst\fP \fBbitset\fP< \fB_Nb\fP > & __rhs)\fC [inline]\fP, \fC [noexcept]\fP" Operations on bitsets\&. .PP \fBParameters\fP .RS 4 \fI__rhs\fP A same-sized bitset\&. .RE .PP These should be self-explanatory\&. .PP Definition at line \fB979\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > \fBstd::bitset\fP< \fB_Nb\fP >::operator~ () const\fC [inline]\fP, \fC [noexcept]\fP" .PP See the no-argument flip()\&. .PP Definition at line \fB1144\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > & \fBstd::bitset\fP< \fB_Nb\fP >::reset ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Sets every bit to false\&. .PP Definition at line \fB1099\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > & \fBstd::bitset\fP< \fB_Nb\fP >::reset (size_t __position)\fC [inline]\fP" .PP Sets a given bit to false\&. .PP \fBParameters\fP .RS 4 \fI__position\fP The index of the bit\&. .RE .PP \fBExceptions\fP .RS 4 \fIstd::out_of_range\fP If \fIpos\fP is bigger the size of the set\&. .RE .PP Same as writing \fCset(pos,false)\fP\&. .PP Definition at line \fB1113\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > & \fBstd::bitset\fP< \fB_Nb\fP >::set ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Sets every bit to true\&. .PP Definition at line \fB1075\fP of file \fBbitset\fP\&. .SS "template \fBbitset\fP< \fB_Nb\fP > & \fBstd::bitset\fP< \fB_Nb\fP >::set (size_t __position, bool __val = \fC\fBtrue\fP\fP)\fC [inline]\fP" .PP Sets a given bit to a particular value\&. .PP \fBParameters\fP .RS 4 \fI__position\fP The index of the bit\&. .br \fI__val\fP Either true or false, defaults to true\&. .RE .PP \fBExceptions\fP .RS 4 \fIstd::out_of_range\fP If \fIpos\fP is bigger the size of the set\&. .RE .PP .PP Definition at line \fB1089\fP of file \fBbitset\fP\&. .SS "template \fBconstexpr\fP size_t \fBstd::bitset\fP< \fB_Nb\fP >::size () const\fC [inline]\fP, \fC [constexpr]\fP, \fC [noexcept]\fP" .PP Returns the total number of bits\&. .PP Definition at line \fB1300\fP of file \fBbitset\fP\&. .SS "template bool \fBstd::bitset\fP< \fB_Nb\fP >::test (size_t __position) const\fC [inline]\fP" .PP Tests the value of a bit\&. .PP \fBParameters\fP .RS 4 \fI__position\fP The index of a bit\&. .RE .PP \fBReturns\fP .RS 4 The value at \fIpos\fP\&. .RE .PP \fBExceptions\fP .RS 4 \fIstd::out_of_range\fP If \fIpos\fP is bigger the size of the set\&. .RE .PP .PP Definition at line \fB1321\fP of file \fBbitset\fP\&. .SS "template template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > \fBstd::bitset\fP< \fB_Nb\fP >::to_string () const\fC [inline]\fP" .PP Returns a character interpretation of the bitset\&. .PP \fBReturns\fP .RS 4 The string equivalent of the bits\&. .RE .PP Note the ordering of the bits: decreasing character positions correspond to increasing bit positions (see the main class notes for an example)\&. .PP Definition at line \fB1197\fP of file \fBbitset\fP\&. .SS "template template<\fBclass\fP _CharT , \fBclass\fP _Traits > \fBstd::basic_string\fP< _CharT, _Traits, \fBstd::allocator\fP< _CharT > > \fBstd::bitset\fP< \fB_Nb\fP >::to_string () const\fC [inline]\fP" .PP Definition at line \fB1219\fP of file \fBbitset\fP\&. .SS "template template<\fBclass\fP _CharT > \fBstd::basic_string\fP< _CharT, \fBstd::char_traits\fP< _CharT >, \fBstd::allocator\fP< _CharT > > \fBstd::bitset\fP< \fB_Nb\fP >::to_string () const\fC [inline]\fP" .PP Definition at line \fB1233\fP of file \fBbitset\fP\&. .SS "template \fBstd::basic_string\fP< char, \fBstd::char_traits\fP< char >, \fBstd::allocator\fP< char > > \fBstd::bitset\fP< \fB_Nb\fP >::to_string () const\fC [inline]\fP" .PP Definition at line \fB1249\fP of file \fBbitset\fP\&. .SS "template template<\fBclass\fP _CharT , \fBclass\fP _Traits , \fBclass\fP _Alloc > \fBstd::basic_string\fP< _CharT, _Traits, _Alloc > \fBstd::bitset\fP< \fB_Nb\fP >::to_string (_CharT __zero, _CharT __one = \fC_CharT('1')\fP) const\fC [inline]\fP" .PP Definition at line \fB1208\fP of file \fBbitset\fP\&. .SS "template template<\fBclass\fP _CharT , \fBclass\fP _Traits > \fBstd::basic_string\fP< _CharT, _Traits, \fBstd::allocator\fP< _CharT > > \fBstd::bitset\fP< \fB_Nb\fP >::to_string (_CharT __zero, _CharT __one = \fC_CharT('1')\fP) const\fC [inline]\fP" .PP Definition at line \fB1226\fP of file \fBbitset\fP\&. .SS "template template<\fBclass\fP _CharT > \fBstd::basic_string\fP< _CharT, \fBstd::char_traits\fP< _CharT >, \fBstd::allocator\fP< _CharT > > \fBstd::bitset\fP< \fB_Nb\fP >::to_string (_CharT __zero, _CharT __one = \fC_CharT('1')\fP) const\fC [inline]\fP" .PP Definition at line \fB1242\fP of file \fBbitset\fP\&. .SS "template \fBstd::basic_string\fP< char, \fBstd::char_traits\fP< char >, \fBstd::allocator\fP< char > > \fBstd::bitset\fP< \fB_Nb\fP >::to_string (char __zero, char __one = \fC'1'\fP) const\fC [inline]\fP" .PP Definition at line \fB1256\fP of file \fBbitset\fP\&. .SS "template unsigned long long \fBstd::bitset\fP< \fB_Nb\fP >::to_ullong () const\fC [inline]\fP" .PP Definition at line \fB1183\fP of file \fBbitset\fP\&. .SS "template unsigned long \fBstd::bitset\fP< \fB_Nb\fP >::to_ulong () const\fC [inline]\fP" .PP Returns a numerical interpretation of the bitset\&. .PP \fBReturns\fP .RS 4 The integral equivalent of the bits\&. .RE .PP \fBExceptions\fP .RS 4 \fIstd::overflow_error\fP If there are too many bits to be represented in an \fCunsigned\fP \fClong\fP\&. .RE .PP .PP Definition at line \fB1178\fP of file \fBbitset\fP\&. .SH "Friends And Related Symbol Documentation" .PP .SS "template friend \fBclass\fP \fBreference\fP\fC [friend]\fP" .PP Definition at line \fB865\fP of file \fBbitset\fP\&. .SS "template friend \fBstruct\fP \fBstd::hash\fP< \fBbitset\fP >\fC [friend]\fP" .PP Definition at line \fB779\fP of file \fBbitset\fP\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.