diff --git a/AK/DistinctNumeric.h b/AK/DistinctNumeric.h index 9d3bc3b4bc3..82f63dd3464 100644 --- a/AK/DistinctNumeric.h +++ b/AK/DistinctNumeric.h @@ -322,6 +322,9 @@ struct Formatter> : Formatter { #define AK_TYPEDEF_DISTINCT_ORDERED_ID(T, NAME) AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(T, NAME, Comparison, CastToBool) // TODO: Further type aliases? +#define AK_MAKE_DISTINCT_NUMERIC_COMPARABLE_TO_ENUM(DN, E) \ + constexpr bool operator==(DN n, E e) { return n.value() == to_underlying(e); } + template struct Traits> : public GenericTraits> { static constexpr bool is_trivial() { return true; }