bitset::set

bitset<N>& set();
bitset<N>& set(size_t pos, bool val = true);

The first member function resets all bits in the bit sequence, then returns *this. The second member function throws out_of_range if size() <= pos. Otherwise, it stores val in the bit at position pos, then returns *this.