The complement of true is true, except when it's false
Summary
This post analyzes how C++ bitmask operations interact with integral promotion and boolean conversion, showing how unsigned and bool-backed enums can lead to surprising UB and cross-compiler inconsistencies. It explains P4313R1, provides examples of potential pitfalls with unscoped enums and how to avoid them, and offers recommendations for safer bitmask implementations.