enum_flags.h¶
| File Path | engine/include/conjure/core/enum_flags.h |
| API ↗ | Data types |
Bitwise operators and helpers for enumerations used as flag sets.
Functions¶
Public¶
has_any_flag¶
has_any_flag¶template <typename EnumType> requires std::is_enum_v<EnumType> [[nodiscard]] constexpr bool has_any_flag(
EnumType value,
EnumType flags) noexcept;True when at least one bit of flags is set in value.
has_flag¶
has_flag¶template <typename EnumType> requires std::is_enum_v<EnumType> [[nodiscard]] constexpr bool has_flag(
EnumType value,
EnumType flag) noexcept;True when every bit of flag is set in value.
to_underlying¶
to_underlying¶template <typename EnumType> requires std::is_enum_v<EnumType> [[nodiscard]] constexpr std::underlying_type_t<EnumType> to_underlying(
EnumType value) noexcept;Converts an enumeration value to its underlying integer.
with_flag¶
with_flag¶template <typename EnumType> requires std::is_enum_v<EnumType> [[nodiscard]] constexpr EnumType with_flag(
EnumType value,
EnumType flag) noexcept;Returns value with the bits of flag set.
without_flag¶
without_flag¶template <typename EnumType> requires std::is_enum_v<EnumType> [[nodiscard]] constexpr EnumType without_flag(
EnumType value,
EnumType flag) noexcept;Returns value with the bits of flag cleared.