From d57d14fc192665189cfea43d258d1e4637d71ef8 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sun, 4 Aug 2024 07:59:50 -0400 Subject: [PATCH] AK: Define FloatingPointExponentialForm comparator in the AK namespace This isn't an issue now because this is only invoked from a macro that is expanded within this file. But in an upcoming commit, it will be invoked from a helper function in the Test namespace. At that point, the compiler complains about the comparitor not being found (and helpfully indicates we should move this one to the AK namespace to allow ADL to succeed). --- Tests/AK/TestStringFloatingPointConversions.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tests/AK/TestStringFloatingPointConversions.cpp b/Tests/AK/TestStringFloatingPointConversions.cpp index f74d7d9bdf3..f296602ba46 100644 --- a/Tests/AK/TestStringFloatingPointConversions.cpp +++ b/Tests/AK/TestStringFloatingPointConversions.cpp @@ -8,11 +8,15 @@ #include #include -static bool operator!=(AK::FloatingPointExponentialForm a, AK::FloatingPointExponentialForm b) +namespace AK { + +static bool operator!=(FloatingPointExponentialForm a, FloatingPointExponentialForm b) { return a.sign != b.sign || a.exponent != b.exponent || a.fraction != b.fraction; } +} + template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, AK::FloatingPointExponentialForm value)