class reference {
public:
reference& operator=(bool b};
reference& operator=(const reference& x);
bool operator~() const;
operator bool() const;
reference& flip();
};
The member class describes an object that designates an individual bit within the bit sequence. Thus, for b
an object of
type bool
, x
and y
objects of type bitset<N>
, and i
and j
valid positions within such an object, the member
functions of class reference
ensure that (in order):
x[i] = b
stores b
at bit position i
in x
x[i] = y[j]
stores the value of the bit y[j]
at bit position i
in x
b = ~x[i]
stores the flipped value of the bit x[i]
in b
b = x[i]
stores the value of the bit x[i]
in b
x[i].flip()
stores the flipped value of the bit x[i]
back at bit position i
in x