std::bitset<N>::test (3) - Linux Manuals
std::bitset<N>::test: std::bitset<N>::test
NAME
std::bitset<N>::test - std::bitset<N>::test
Synopsis
bool test( size_t pos ) const;
Returns the value of the bit at the position pos.
Unlike operator[], performs a bounds check and throws std::out_of_range if pos does not correspond to a valid position in the bitset.
Parameters
pos - position of the bit to return
Return value
true if the requested bit is set, false otherwise.
Exceptions
std::out_of_range if pos does not correspond to a valid position within the bitset.
Example
// Run this code
Output:
See also
operator[] (public member function)