Returns: \*this. bitset & operator>>=(size\_t pos); Effects: Replaces each bit at position I in \*this with a value determined as follows: -If pos >= N -I, the new value is zero; -If pos < N -I, the new value is the previous value of the bit at position I + pos. Returns: \*this. bitset & set(); Effects: Sets all bits in \*this. Returns: \*this. bitset & set(size\_t pos, int val = 1); Requires: pos is valid Throws: out\_of\_range if pos does not correspond to a valid bit position. Effects: Stores a new value in the bit at position pos in \*this. If val is nonzero, the stored value is one, otherwise it is zero. Returns: \*this. bitset & reset(); Effects: Resets all bits in \*this. Returns: \*this. bitset & reset(size\_t pos); ## Requires: pos is valid Throws: out\_of\_range if pos does not correspond to a valid bit position. ## Effects: Resets the bit at position pos in \*this. Returns: \*this. bitset operator~() const; Effects: Constructs an object x of class bitset and initializes it with \*this. ## Returns: x.flip(). bitset & flip(); Effects: Toggles all bits in \*this. Returns: \*this. bitset & flip(size\_t pos); ## Requires: pos is valid Throws: out\_of\_range if pos does not correspond to a valid bit position. ## Effects: Toggles the bit at position pos in \*this. Returns: \*this. unsigned long to\_ulong() const; Throws: overflow\_error if the integral value x corresponding to the bits in \*this cannot be represented as type unsigned long. ## Returns : x. 505 ISO/IEC 14882:1998(E) © ISO/IEC 23.3.5.2 bitset members 23 Containers library template basic\_string to\_string() const; Effects: Constructs a string object of the appropriate type and initializes it to a string of length N characters. Each character is determined by the value of its corresponding bit position in \*this. Character position N -1 corresponds to bit position zero. Subsequent decreasing character positions correspond to increasing bit positions. Bit value zero becomes the character 0, bit value one becomes the character 1. ## Returns: The created object. size\_t count() const; Returns: A count of the number of bits set in \*this. size\_t size() const; Returns: N. bool operator==(const bitset & rhs) const; Returns: A nonzero value if the value of each bit in \*this equals the value of the corresponding bit in rhs. bool operator!=(const bitset & rhs) const; Returns: A nonzero value if !(\*this == rhs). bool test(size\_t pos) const; ## Requires: pos is valid Throws: out\_of\_range if pos does not correspond to a valid bit position. Returns: true if the bit at position pos in \*this has the value one. bool any() const; Returns: true if any bit in \*this is one. bool none() const; Returns: true if no bit in \*this is one. bitset operator>= pos. [lib.bitset.operators] 23.3.5.3 bitset operators bitset operator&(const bitset & lhs, const bitset & rhs); Returns: bitset (lhs) &= rhs. bitset operator|(const bitset & lhs, const bitset & rhs); Returns: bitset (lhs) |= rhs. 506 © ISO/IEC ISO/IEC 14882:1998(E) 23 Containers library 23.3.5.3 bitset operators bitset operator^(const bitset & lhs, const bitset & rhs); Returns: bitset (lhs) ^= rhs. template basic\_istream & operator>>(basic\_istream & is, bitset & x); A formatted input function (27.6.1.2). Effects: Extracts up to N (single-byte) characters from is. Stores these characters in a temporary object str of type string, then evaluates the expression x = bitset (str). Characters are extracted and stored until any of the following occurs: -N characters have been extracted and stored; -end-of-file occurs on the input sequence; -the next input character is neither 0 or 1 (in which case the input character is not extracted). If no characters are stored in str, calls is.setstate(ios::failbit) (which may throw ios\_base::failure (27.4.4.3). Returns: is. template basic\_ostream & operator 27.6.1.3 Unformatted input functions 27.6.1.4 Standard basic_istream manipulators 27.6.1.5 Template class basic_iostream 27.6.1.5.1 basic_iostream constructors 27.6.1.5.2 basic_iostream destructor 27.6.2 Output streams 27.6.2.1 Template class basic_ostream 27.6.2.2 basic_ostream constructors 27.6.2.3 Class basic_ostream::sentry 27.6.2.4 basic_ostream seek members 27.6.2.5 Formatted output functions 27.6.2.5.1 Common requirements 27.6.2.5.2 Arithmetic Inserters 27.6.2.5.3 basic_ostream::operator