std::bitset
A fixed-size sequence of bits with convenient operations.
Easy
std::bitset<8> flags{0b1010'0001}; flags.set(3); flags.count();
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.