![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
Go to the source code of this file.
Namespaces | |
| namespace | NEnumRangePrivate |
| namespace | UE |
| namespace | UE::EnumFlags |
| namespace | UE::EnumFlags::Private |
Macros | |
| #define | ENUM_RANGE_BY_COUNT(EnumType, Count) ENUM_RANGE_BY_FIRST_AND_LAST(EnumType, 0, (std::underlying_type_t<EnumType>)(Count) - 1) |
| #define | ENUM_RANGE_BY_FIRST_AND_LAST(EnumType, First, Last) |
| #define | ENUM_RANGE_BY_VALUES(EnumType, ...) |
Functions | |
| template<typename EnumType > | |
| UE::EnumFlags::Private::TRange< EnumType > | MakeFlagsRange (EnumType Flags) |
| #define ENUM_RANGE_BY_COUNT | ( | EnumType, | |
| Count | |||
| ) | ENUM_RANGE_BY_FIRST_AND_LAST(EnumType, 0, (std::underlying_type_t<EnumType>)(Count) - 1) |
Defines a contiguous enum range containing Count values, starting from zero:
Example:
enum class ECountedThing { First, Second, Third,
Count };
// Defines iteration over ECountedThing to be: First, Second, Third ENUM_RANGE_BY_COUNT(ECountedThing, ECountedThing::Count)
Defines a contiguous enum range with specific start and end values:
Example:
enum class EDoubleEndedThing { Invalid,
First, Second, Third,
Count };
// Defines iteration over EDoubleEndedThing to be: First, Second, Third ENUM_RANGE_BY_FIRST_AND_LAST(EDoubleEndedThing, EDoubleEndedThing::First, EDoubleEndedThing::Third)
| #define ENUM_RANGE_BY_VALUES | ( | EnumType, | |
| ... | |||
| ) |
Defines a non-contiguous enum range with specific individual values:
Example:
enum class ERandomValuesThing { First = 2, Second = 3, Third = 5, Fourth = 7, Fifth = 11 };
// Defines iteration over ERandomValuesThing to be: First, Second, Third, Fourth, Fifth ENUM_RANGE_BY_VALUES(ERandomValuesThing, ERandomValuesThing::First, ERandomValuesThing::Second, ERandomValuesThing::Third, ERandomValuesThing::Fourth, ERandomValuesThing::Fifth)
| UE::EnumFlags::Private::TRange< EnumType > MakeFlagsRange | ( | EnumType | Flags | ) |
Make a range for iterating over set flags in a flags enum.
Example:
EFlagThing Flags = EFlagThing::A | EFlagThing::B; for (EFlagThing Flag : MakeFlagsRange(Flags)) { // Loop is run twice, once with Flag = EFlagThing::A, once with Flag = EFlagThing::B ... }