How to overload |= operator on scoped enum?

inline NumericType& operator |=(NumericType& a, NumericType b) { return a= a |b; } This works? Compile and run: (Ideone) #include <iostream> using namespace std; enum class NumericType { None = 0, PadWithZero = 0x01, NegativeSign = 0x02, PositiveSign = 0x04, SpacePrefix = 0x08 }; inline NumericType operator |(NumericType a, NumericType b) { return static_cast<NumericType>(static_cast<int>(a) | … Read more

What’s the result of a & b?

This is underspecified. The issue of what the standard means when it refers to bit-wise operations is the subject of a few defect reports. For example defect report 1857: Additional questions about bits: The specification of the bitwise operations in 5.11 [expr.bit.and], 5.12 [expr.xor], and 5.13 [expr.or] uses the undefined term “bitwise” in describing the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)