C++11 standard conformant bitmasks using enum class

后端 未结 5 1227
春和景丽
春和景丽 2021-01-31 03:17

Can you implement standard conformant (as described in 17.5.2.1.3 of the n3242 draft) type safe bitmasks using enum class? The way I read it, a type T is a bitmask if it support

5条回答
  •  独厮守ぢ
    2021-01-31 03:56

    Scoped enumerations (those created with either enum class or enum struct) are not classes. They cannot have member functions, they just provide enclosed enumerators (not visible at namespace level).

提交回复
热议问题