Thanks for the comment. The code at https://softwareengineering.stackexchange.com/a/338472/189774 is an interesting example of a flag implementation, as it also maps enum values to bit positions. However, while it claims to offer type safety, it only provides bitwise operator overloads for the given enum. This seems fine since the features work, but there is a problem: erroneous code still compiles. For example, when two different enums are accidentally mixed: enum e {e0, e1, e2, e3}; enum f {f0, f1, f2, f3}; if ((e0 | e3) & e1) {...} // uses bitflag class -> evaluates to false if ((e0 | f3) & e1) {...} // use integral promotion and built-in operators -> evaluates to true Of course, this problem only exists for unscoped enums, but flag-like enums are usually defined that way. My Flags library dedicates a lot of code to prohibiting operations that should not compile; for an enabled enum, only bitwise operators with itself or its complement type are allowed.