#include <iostream>
 
enum class NumericType
{
    None                    = 0,
    PadWithZero             = 0x01,
    NegativeSign            = 0x02,
    PositiveSign            = 0x04,
    SpacePrefix             = 0x08
};
 
NumericType operator |= (NumericType &a, NumericType b) {
    unsigned ai = static_cast<unsigned>(a);
    unsigned bi = static_cast<unsigned>(b);
    ai |= bi;
    return a = static_cast<NumericType>(ai);
}

std::ostream & operator << (std::ostream &os, NumericType x) {
    return os << static_cast<unsigned>(x);
}
 
int main ()
{
    NumericType a = NumericType::PadWithZero;
    NumericType b = NumericType::SpacePrefix;
    a |= b;
    std::cout
        << std::hex
        << "a: " << a << std::endl
        << "b: " << b << std::endl;
}