mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
Notes:
sideshowbarker
2024-07-17 16:21:09 +09:00
Author: https://github.com/IdanHo
Commit: 086969277e
Pull-request: https://github.com/SerenityOS/serenity/pull/12321
Reviewed-by: https://github.com/BertalanD
Reviewed-by: https://github.com/bgianfo ✅
1665 changed files with 8479 additions and 8479 deletions
|
@ -63,11 +63,11 @@ public:
|
|||
constexpr T& value() { return m_value; }
|
||||
|
||||
// Always implemented: identity.
|
||||
constexpr bool operator==(const Self& other) const
|
||||
constexpr bool operator==(Self const& other) const
|
||||
{
|
||||
return this->m_value == other.m_value;
|
||||
}
|
||||
constexpr bool operator!=(const Self& other) const
|
||||
constexpr bool operator!=(Self const& other) const
|
||||
{
|
||||
return this->m_value != other.m_value;
|
||||
}
|
||||
|
@ -101,22 +101,22 @@ public:
|
|||
}
|
||||
|
||||
// Only implemented when `Cmp` is true:
|
||||
constexpr bool operator>(const Self& other) const
|
||||
constexpr bool operator>(Self const& other) const
|
||||
{
|
||||
static_assert(Cmp, "'a>b' is only available for DistinctNumeric types with 'Cmp'.");
|
||||
return this->m_value > other.m_value;
|
||||
}
|
||||
constexpr bool operator<(const Self& other) const
|
||||
constexpr bool operator<(Self const& other) const
|
||||
{
|
||||
static_assert(Cmp, "'a<b' is only available for DistinctNumeric types with 'Cmp'.");
|
||||
return this->m_value < other.m_value;
|
||||
}
|
||||
constexpr bool operator>=(const Self& other) const
|
||||
constexpr bool operator>=(Self const& other) const
|
||||
{
|
||||
static_assert(Cmp, "'a>=b' is only available for DistinctNumeric types with 'Cmp'.");
|
||||
return this->m_value >= other.m_value;
|
||||
}
|
||||
constexpr bool operator<=(const Self& other) const
|
||||
constexpr bool operator<=(Self const& other) const
|
||||
{
|
||||
static_assert(Cmp, "'a<=b' is only available for DistinctNumeric types with 'Cmp'.");
|
||||
return this->m_value <= other.m_value;
|
||||
|
@ -140,34 +140,34 @@ public:
|
|||
static_assert(Flags, "'~a' is only available for DistinctNumeric types with 'Flags'.");
|
||||
return ~this->m_value;
|
||||
}
|
||||
constexpr Self operator&(const Self& other) const
|
||||
constexpr Self operator&(Self const& other) const
|
||||
{
|
||||
static_assert(Flags, "'a&b' is only available for DistinctNumeric types with 'Flags'.");
|
||||
return this->m_value & other.m_value;
|
||||
}
|
||||
constexpr Self operator|(const Self& other) const
|
||||
constexpr Self operator|(Self const& other) const
|
||||
{
|
||||
static_assert(Flags, "'a|b' is only available for DistinctNumeric types with 'Flags'.");
|
||||
return this->m_value | other.m_value;
|
||||
}
|
||||
constexpr Self operator^(const Self& other) const
|
||||
constexpr Self operator^(Self const& other) const
|
||||
{
|
||||
static_assert(Flags, "'a^b' is only available for DistinctNumeric types with 'Flags'.");
|
||||
return this->m_value ^ other.m_value;
|
||||
}
|
||||
constexpr Self& operator&=(const Self& other)
|
||||
constexpr Self& operator&=(Self const& other)
|
||||
{
|
||||
static_assert(Flags, "'a&=b' is only available for DistinctNumeric types with 'Flags'.");
|
||||
this->m_value &= other.m_value;
|
||||
return *this;
|
||||
}
|
||||
constexpr Self& operator|=(const Self& other)
|
||||
constexpr Self& operator|=(Self const& other)
|
||||
{
|
||||
static_assert(Flags, "'a|=b' is only available for DistinctNumeric types with 'Flags'.");
|
||||
this->m_value |= other.m_value;
|
||||
return *this;
|
||||
}
|
||||
constexpr Self& operator^=(const Self& other)
|
||||
constexpr Self& operator^=(Self const& other)
|
||||
{
|
||||
static_assert(Flags, "'a^=b' is only available for DistinctNumeric types with 'Flags'.");
|
||||
this->m_value ^= other.m_value;
|
||||
|
@ -176,23 +176,23 @@ public:
|
|||
|
||||
// Only implemented when `Shift` is true:
|
||||
// TODO: Should this take `int` instead?
|
||||
constexpr Self operator<<(const Self& other) const
|
||||
constexpr Self operator<<(Self const& other) const
|
||||
{
|
||||
static_assert(Shift, "'a<<b' is only available for DistinctNumeric types with 'Shift'.");
|
||||
return this->m_value << other.m_value;
|
||||
}
|
||||
constexpr Self operator>>(const Self& other) const
|
||||
constexpr Self operator>>(Self const& other) const
|
||||
{
|
||||
static_assert(Shift, "'a>>b' is only available for DistinctNumeric types with 'Shift'.");
|
||||
return this->m_value >> other.m_value;
|
||||
}
|
||||
constexpr Self& operator<<=(const Self& other)
|
||||
constexpr Self& operator<<=(Self const& other)
|
||||
{
|
||||
static_assert(Shift, "'a<<=b' is only available for DistinctNumeric types with 'Shift'.");
|
||||
this->m_value <<= other.m_value;
|
||||
return *this;
|
||||
}
|
||||
constexpr Self& operator>>=(const Self& other)
|
||||
constexpr Self& operator>>=(Self const& other)
|
||||
{
|
||||
static_assert(Shift, "'a>>=b' is only available for DistinctNumeric types with 'Shift'.");
|
||||
this->m_value >>= other.m_value;
|
||||
|
@ -200,12 +200,12 @@ public:
|
|||
}
|
||||
|
||||
// Only implemented when `Arith` is true:
|
||||
constexpr Self operator+(const Self& other) const
|
||||
constexpr Self operator+(Self const& other) const
|
||||
{
|
||||
static_assert(Arith, "'a+b' is only available for DistinctNumeric types with 'Arith'.");
|
||||
return this->m_value + other.m_value;
|
||||
}
|
||||
constexpr Self operator-(const Self& other) const
|
||||
constexpr Self operator-(Self const& other) const
|
||||
{
|
||||
static_assert(Arith, "'a-b' is only available for DistinctNumeric types with 'Arith'.");
|
||||
return this->m_value - other.m_value;
|
||||
|
@ -220,46 +220,46 @@ public:
|
|||
static_assert(Arith, "'-a' is only available for DistinctNumeric types with 'Arith'.");
|
||||
return -this->m_value;
|
||||
}
|
||||
constexpr Self operator*(const Self& other) const
|
||||
constexpr Self operator*(Self const& other) const
|
||||
{
|
||||
static_assert(Arith, "'a*b' is only available for DistinctNumeric types with 'Arith'.");
|
||||
return this->m_value * other.m_value;
|
||||
}
|
||||
constexpr Self operator/(const Self& other) const
|
||||
constexpr Self operator/(Self const& other) const
|
||||
{
|
||||
static_assert(Arith, "'a/b' is only available for DistinctNumeric types with 'Arith'.");
|
||||
return this->m_value / other.m_value;
|
||||
}
|
||||
constexpr Self operator%(const Self& other) const
|
||||
constexpr Self operator%(Self const& other) const
|
||||
{
|
||||
static_assert(Arith, "'a%b' is only available for DistinctNumeric types with 'Arith'.");
|
||||
return this->m_value % other.m_value;
|
||||
}
|
||||
constexpr Self& operator+=(const Self& other)
|
||||
constexpr Self& operator+=(Self const& other)
|
||||
{
|
||||
static_assert(Arith, "'a+=b' is only available for DistinctNumeric types with 'Arith'.");
|
||||
this->m_value += other.m_value;
|
||||
return *this;
|
||||
}
|
||||
constexpr Self& operator-=(const Self& other)
|
||||
constexpr Self& operator-=(Self const& other)
|
||||
{
|
||||
static_assert(Arith, "'a+=b' is only available for DistinctNumeric types with 'Arith'.");
|
||||
this->m_value += other.m_value;
|
||||
return *this;
|
||||
}
|
||||
constexpr Self& operator*=(const Self& other)
|
||||
constexpr Self& operator*=(Self const& other)
|
||||
{
|
||||
static_assert(Arith, "'a*=b' is only available for DistinctNumeric types with 'Arith'.");
|
||||
this->m_value *= other.m_value;
|
||||
return *this;
|
||||
}
|
||||
constexpr Self& operator/=(const Self& other)
|
||||
constexpr Self& operator/=(Self const& other)
|
||||
{
|
||||
static_assert(Arith, "'a/=b' is only available for DistinctNumeric types with 'Arith'.");
|
||||
this->m_value /= other.m_value;
|
||||
return *this;
|
||||
}
|
||||
constexpr Self& operator%=(const Self& other)
|
||||
constexpr Self& operator%=(Self const& other)
|
||||
{
|
||||
static_assert(Arith, "'a%=b' is only available for DistinctNumeric types with 'Arith'.");
|
||||
this->m_value %= other.m_value;
|
||||
|
@ -292,7 +292,7 @@ struct Formatter<DistinctNumeric<T, X, Incr, Cmp, Bool, Flags, Shift, Arith>> :
|
|||
template<typename T, typename X, auto... Args>
|
||||
struct Traits<AK::DistinctNumeric<T, X, Args...>> : public GenericTraits<AK::DistinctNumeric<T, X, Args...>> {
|
||||
static constexpr bool is_trivial() { return true; }
|
||||
static constexpr auto hash(const DistinctNumeric<T, X, Args...>& d) { return Traits<T>::hash(d.value()); }
|
||||
static constexpr auto hash(DistinctNumeric<T, X, Args...> const& d) { return Traits<T>::hash(d.value()); }
|
||||
};
|
||||
|
||||
using AK::DistinctNumeric;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue