mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:07:34 +00:00
AK/Complex: C++20-compatible comparison operators
Problem: - Clang correctly reports non-`const` member function comparison operators as ambiguous. Solution: - Make them `const`.
This commit is contained in:
parent
97f4aa166a
commit
0ac02b9084
2 changed files with 9 additions and 2 deletions
|
@ -243,13 +243,13 @@ public:
|
|||
}
|
||||
|
||||
template<AK::Concepts::Arithmetic U>
|
||||
constexpr bool operator==(const Complex<U>& a)
|
||||
constexpr bool operator==(const Complex<U>& a) const
|
||||
{
|
||||
return (this->real() == a.real()) && (this->imag() == a.imag());
|
||||
}
|
||||
|
||||
template<AK::Concepts::Arithmetic U>
|
||||
constexpr bool operator!=(const Complex<U>& a)
|
||||
constexpr bool operator!=(const Complex<U>& a) const
|
||||
{
|
||||
return !(*this == a);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue