mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
AK: Patch ArbitrarySizedEnum
operators for missing constructor
Patch kindly provided by Ali on #aarch64 on Discord. Co-authored-by: Ali Mohammad Pur <mpfard@serenityos.org>
This commit is contained in:
parent
0f81fb03f2
commit
9f736d782c
Notes:
sideshowbarker
2024-07-19 16:58:58 +09:00
Author: https://github.com/konradekk Commit: https://github.com/SerenityOS/serenity/commit/9f736d782c0 Pull-request: https://github.com/SerenityOS/serenity/pull/16781 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/gmta
@ -7,6 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Badge.h>
|
||||
#include <AK/DistinctNumeric.h>
|
||||
|
||||
namespace AK {
|
||||
@ -66,22 +67,22 @@ struct ArbitrarySizedEnum : public T {
|
||||
|
||||
[[nodiscard]] constexpr ArbitrarySizedEnum<T> operator|(ArbitrarySizedEnum<T> const& other) const
|
||||
{
|
||||
return { T(this->value() | other.value()), {} };
|
||||
return { T(this->value() | other.value()), Badge<ArbitrarySizedEnum<T>> {} };
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr ArbitrarySizedEnum<T> operator&(ArbitrarySizedEnum<T> const& other) const
|
||||
{
|
||||
return { T(this->value() & other.value()), {} };
|
||||
return { T(this->value() & other.value()), Badge<ArbitrarySizedEnum<T>> {} };
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr ArbitrarySizedEnum<T> operator^(ArbitrarySizedEnum<T> const& other) const
|
||||
{
|
||||
return { T(this->value() ^ other.value()), {} };
|
||||
return { T(this->value() ^ other.value()), Badge<ArbitrarySizedEnum<T>> {} };
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr ArbitrarySizedEnum<T> operator~() const
|
||||
{
|
||||
return { T(~this->value()), {} };
|
||||
return { T(~this->value()), Badge<ArbitrarySizedEnum<T>> {} };
|
||||
}
|
||||
|
||||
constexpr ArbitrarySizedEnum<T>& operator|=(ArbitrarySizedEnum<T> const& other)
|
||||
|
Loading…
Reference in New Issue
Block a user