bitset::test

bool test(size_t pos, bool val = true);

The member function throws out_of_range if size() <= pos. Otherwise, it returns true only if the bit at position pos is set.