35#define ENUM_OPERATORS(_enum_type) \
36 [[maybe_unused]] [[nodiscard]] inline constexpr _enum_type operator|(_enum_type a, \
39 return (_enum_type)(uint64_t(a) | uint64_t(b)); \
41 [[maybe_unused]] [[nodiscard]] inline constexpr _enum_type operator&(_enum_type a, \
44 return (_enum_type)(uint64_t(a) & uint64_t(b)); \
46 [[maybe_unused]] [[nodiscard]] inline constexpr _enum_type operator&( \
47 _enum_type a, ::blender::BitwiseNotEnumValue<_enum_type> b) \
49 return (_enum_type)(uint64_t(a) & uint64_t(b.value)); \
51 [[maybe_unused]] [[nodiscard]] inline constexpr ::blender::BitwiseNotEnumValue<_enum_type> \
52 operator~(_enum_type a) \
54 ::blender::BitwiseNotEnumValue<_enum_type> result = {~uint64_t(a)}; \
57 [[maybe_unused]] inline _enum_type &operator|=(_enum_type &a, _enum_type b) \
59 return a = (_enum_type)(uint64_t(a) | uint64_t(b)); \
61 [[maybe_unused]] inline _enum_type &operator&=(_enum_type &a, _enum_type b) \
63 return a = (_enum_type)(uint64_t(a) & uint64_t(b)); \
65 [[maybe_unused]] inline _enum_type &operator&=(_enum_type &a, \
66 ::blender::BitwiseNotEnumValue<_enum_type> b) \
68 return a = (_enum_type)(uint64_t(a) & uint64_t(b.value)); \
70 [[maybe_unused]] inline _enum_type &operator^=(_enum_type &a, _enum_type b) \
72 return a = (_enum_type)(uint64_t(a) ^ uint64_t(b)); \
74 [[maybe_unused]] [[nodiscard]] inline constexpr bool flag_is_set(_enum_type flags, \
75 _enum_type flag_to_test) \
77 return (uint64_t(flags) & uint64_t(flag_to_test)) != 0; \
unsigned __int64 uint64_t