52#define JUCE_DECLARE_SCOPED_ENUM_BITWISE_OPERATORS(EnumType) \
53 static_assert (std::is_enum_v<EnumType>, \
54 "JUCE_DECLARE_SCOPED_ENUM_BITWISE_OPERATORS " \
55 "should only be used with enum types"); \
56 constexpr auto operator& (EnumType a, EnumType b) \
58 using base_type = std::underlying_type<EnumType>::type; \
59 return static_cast<EnumType> (base_type (a) & base_type (b)); \
61 constexpr auto operator| (EnumType a, EnumType b) \
63 using base_type = std::underlying_type<EnumType>::type; \
64 return static_cast<EnumType> (base_type (a) | base_type (b)); \
66 constexpr auto operator~ (EnumType a) \
68 using base_type = std::underlying_type<EnumType>::type; \
69 return static_cast<EnumType> (~base_type (a)); \
71 constexpr auto& operator|= (EnumType& a, EnumType b) \
76 constexpr auto& operator&= (EnumType& a, EnumType b) \
86template <
typename EnumType, std::enable_if_t<std::is_enum_v<EnumType>,
int> = 0>
92template <
typename EnumType, std::enable_if_t<std::is_enum_v<EnumType>,
int> = 0>
98template <
typename EnumType, std::enable_if_t<std::is_enum_v<EnumType>,
int> = 0>
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...