16#include "../core/enum_type.hpp"
18#include "../3rdparty/catch2/catch.hpp"
20enum TestEnum : int8_t {
26TEST_CASE(
"EnumOverOptimisation_BoundsCheck")
28 TestEnum negative_one =
static_cast<TestEnum
>(-1);
29 CHECK(negative_one < ZERO);
31 TestEnum three =
static_cast<TestEnum
>(3);
35enum class TestEnumFlags : uint8_t {
42TEST_CASE(
"EnumOverOptimisation_Bitmask")
44 TestEnumFlags three = TestEnumFlags::One | TestEnumFlags::Two;
45 CHECK(
HasFlag(three, TestEnumFlags::One));
46 CHECK(
HasFlag(three, TestEnumFlags::Two));
#define DECLARE_ENUM_AS_BIT_SET(enum_type)
Operators to allow to work with enum as with type safe bit set in C++.
debug_inline constexpr bool HasFlag(const T x, const T y)
Checks if a value in a bitset enum is set.