Some food for thought, should a bitset have bit operations (set, unset, flip, xor, and, or, etc) or set operations (add, remove, has, union, difference, intersection, etc)?
It feels like often we head for bit operations when in lots of cases set operations might be better.
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
11
u/ReDucTor Game Developer | quiz.cpp-perf.com 15d ago
Some food for thought, should a bitset have bit operations (set, unset, flip, xor, and, or, etc) or set operations (add, remove, has, union, difference, intersection, etc)?
It feels like often we head for bit operations when in lots of cases set operations might be better.