5#ifndef SAPPHIRE_SUPPORT_FLAGS_GUARD
6#define SAPPHIRE_SUPPORT_FLAGS_GUARD
28 template <u
int32_t size>
32 struct IntSizeT<sizeof(int8_t)>
35 using uintT = uint8_t;
39 struct IntSizeT<sizeof(int16_t)>
42 using uintT = uint16_t;
46 struct IntSizeT<sizeof(int32_t)>
49 using uintT = uint32_t;
53 struct IntSizeT<sizeof(int64_t)>
56 using uintT = uint64_t;
59 #define __SA_EINT(EnumType) SA::Intl::IntSizeT<sizeof(EnumType)>::intT
60 #define __SA_EUINT(EnumType) SA::Intl::IntSizeT<sizeof(EnumType)>::uintT
63 #define __SA_DEFINE_ENUM_CLASS_FLAGS_OP(EnumType, op)\
64 inline constexpr __SA_EUINT(EnumType) operator op(EnumType _e1, EnumType _e2) {\
65 return static_cast<__SA_EUINT(EnumType)>(_e1) op static_cast<__SA_EUINT(EnumType)>(_e2);\
67 inline constexpr __SA_EUINT(EnumType) operator op(__SA_EUINT(EnumType) _flags, EnumType _e) {\
68 return _flags op static_cast<__SA_EUINT(EnumType)>(_e);\
70 inline constexpr __SA_EUINT(EnumType) operator op(EnumType _e, __SA_EUINT(EnumType) _flags) {\
71 return static_cast<__SA_EUINT(EnumType)>(_e) op _flags;\
73 inline __SA_EUINT(EnumType)& operator op##=(__SA_EUINT(EnumType)& _flags, EnumType _e) {\
74 return _flags op##= static_cast<__SA_EUINT(EnumType)>(_e);\
80 #define SA_DEFINE_ENUM_CLASS_FLAGS(EnumType)\
81 __SA_DEFINE_ENUM_CLASS_FLAGS_OP(EnumType, &)\
82 __SA_DEFINE_ENUM_CLASS_FLAGS_OP(EnumType, |)\
83 __SA_DEFINE_ENUM_CLASS_FLAGS_OP(EnumType, ^)\
84 inline constexpr __SA_EUINT(EnumType) operator ~(EnumType _e){\
85 return ~static_cast<__SA_EUINT(EnumType)>(_e);\
87 inline constexpr __SA_EUINT(EnumType) operator +(EnumType _e){\
88 return static_cast<__SA_EUINT(EnumType)>(_e);\