mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: Fix typo in -= operator of DistinctNumeric
This commit is contained in:
parent
b2a04ff48a
commit
c6d494513e
Notes:
sideshowbarker
2024-07-17 02:56:25 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/c6d494513e Pull-request: https://github.com/SerenityOS/serenity/pull/16836 Reviewed-by: https://github.com/MacDue
2 changed files with 6 additions and 2 deletions
|
@ -286,8 +286,8 @@ public:
|
||||||
}
|
}
|
||||||
constexpr Self& operator-=(Self const& other)
|
constexpr Self& operator-=(Self const& other)
|
||||||
{
|
{
|
||||||
static_assert(options.arithmetic, "'a+=b' is only available for DistinctNumeric types with 'Arithmetic'.");
|
static_assert(options.arithmetic, "'a-=b' is only available for DistinctNumeric types with 'Arithmetic'.");
|
||||||
this->m_value += other.m_value;
|
this->m_value -= other.m_value;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
constexpr Self& operator*=(Self const& other)
|
constexpr Self& operator*=(Self const& other)
|
||||||
|
|
|
@ -197,6 +197,10 @@ TEST_CASE(operator_arith)
|
||||||
EXPECT_EQ(a, ArithNumeric(1));
|
EXPECT_EQ(a, ArithNumeric(1));
|
||||||
EXPECT_EQ(a %= a, ArithNumeric(0));
|
EXPECT_EQ(a %= a, ArithNumeric(0));
|
||||||
EXPECT_EQ(a, ArithNumeric(0));
|
EXPECT_EQ(a, ArithNumeric(0));
|
||||||
|
|
||||||
|
a = ArithNumeric(12);
|
||||||
|
EXPECT_EQ(a -= a, ArithNumeric(0));
|
||||||
|
EXPECT_EQ(a, ArithNumeric(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE(composability)
|
TEST_CASE(composability)
|
||||||
|
|
Loading…
Reference in a new issue