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:
konrad 2023-01-11 22:41:29 +01:00 committed by Jelle Raaijmakers
parent 0f81fb03f2
commit 9f736d782c
Notes: sideshowbarker 2024-07-19 16:58:58 +09:00

View file

@ -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)