r/cpp • u/meetingcpp Meeting C++ | C++ Evangelist • Jul 19 '26
A better bitset for enum flags
https://www.elbeno.com/blog/?p=1836
43
Upvotes
r/cpp • u/meetingcpp Meeting C++ | C++ Evangelist • Jul 19 '26
View all comments
Show parent comment
14
u/TheVoidInMe Jul 19 '26
I like Java’s approach here (yes, Java) which has an EnumSet instead of a bitset. That naming makes the answer pretty clear; the bit math is purely an implementation detail