mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
AK: Patch ArbitrarySizedEnum operators for missing constructor
Patch kindly provided by Ali on #aarch64 on Discord. Co-authored-by: Ali Mohammad Pur <[email protected]>
This commit is contained in:
1 parent
0f81fb03f2
commit
9f736d782c
1 file changed
+5
-4
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user