// Wrapper type for flags fields based on an enum type. // // EnumFlags does not (implicitly) convert to/from the underlying integer type. // That can be supported for specific flags fields by deriving from this class // and implementing an extra constructor and/or |operator FieldType|. // // Note: this type is similar to mfbt/EnumSet.h, but has the same size in debug // and release builds so is more appropriate for core data structures where we // don't want this size difference. template <typename EnumType> class EnumFlags { protected: // Use the enum's underlying type for the flags field. This makes JIT accesses // more predictable and simplifies the implementation of this class.
static_assert(std::is_enum_v<EnumType>); using FieldType = std::underlying_type_t<EnumType>;
static_assert(std::is_unsigned_v<FieldType>);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.