mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:04:59 +00:00
AK+Everywhere: Replace DistinctNumeric bool parameters with named ones
This means that rather than this: ``` AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, true, true, false, false, false, true, FunctionAddress); ``` We now have this: ``` AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, FunctionAddress, Arithmetic, Comparison, Increment); ``` Which is a lot more readable. :^) Co-authored-by: Ali Mohammad Pur <mpfard@serenityos.org>
This commit is contained in:
parent
24c0a6e9a4
commit
c33eae24f9
7 changed files with 133 additions and 92 deletions
|
@ -113,13 +113,12 @@ struct ArbitrarySizedEnum : public T {
|
|||
}
|
||||
};
|
||||
|
||||
#define AK_MAKE_ARBITRARY_SIZED_ENUM(EnumName, T, ...) \
|
||||
namespace EnumName { \
|
||||
using EnumName = ArbitrarySizedEnum<DistinctNumeric<T, struct __##EnumName##Tag, \
|
||||
false, true, false, false, false, false>>; \
|
||||
using Type = EnumName; \
|
||||
using UnderlyingType = T; \
|
||||
inline constexpr static EnumName __VA_ARGS__; \
|
||||
#define AK_MAKE_ARBITRARY_SIZED_ENUM(EnumName, T, ...) \
|
||||
namespace EnumName { \
|
||||
using EnumName = ArbitrarySizedEnum<DistinctNumeric<T, struct __##EnumName##Tag, AK::DistinctNumericFeature::Comparison>>; \
|
||||
using Type = EnumName; \
|
||||
using UnderlyingType = T; \
|
||||
inline constexpr static EnumName __VA_ARGS__; \
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue