mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05: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
1 changed files with 5 additions and 4 deletions
|
@ -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 a new issue