Как универсально определить битовые операции.
/* bitflags operators */
template <class T>
concept bool BitFlagsType = requires(T t) { BitFlagsEnabler(t); } ;
template <BitFlagsType T>
T operator | (T a,T b) { return T( unsigned(a)|b ); }
template <BitFlagsType T>
T operator |= (T &a,T b) { return a=(a|b); }
/* enum CharFlags */
enum CharFlags : unsigned
{
CharNull = 0,
CharLetter = Bit(0),
CharDigit = Bit(1),
CharPunct = Bit(2),
CharQuote = Bit(3),
CharSpace = Bit(4),
CharEOL = Bit(5),
CharHex = Bit(6),
CharOct = Bit(7),
CharPunct2 = Bit(8),
CharPunct3 = Bit(9)
};
inline void BitFlagsEnabler(CharFlags) {} // включаем битовые операции с этим типом