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).
This commit is contained in:
Timothy Flynn 2024-08-04 07:59:50 -04:00 committed by Andreas Kling
parent 831e5ed4e2
commit d57d14fc19
Notes: github-actions[bot] 2024-08-13 12:14:02 +00:00

View file

@ -8,11 +8,15 @@
#include <AK/StringFloatingPointConversions.h>
#include <LibTest/TestCase.h>
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<AK::FloatingPointExponentialForm> : Formatter<FormatString> {
ErrorOr<void> format(FormatBuilder& builder, AK::FloatingPointExponentialForm value)