Browse Source

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).
Timothy Flynn 1 năm trước cách đây
mục cha
commit
d57d14fc19
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      Tests/AK/TestStringFloatingPointConversions.cpp

+ 5 - 1
Tests/AK/TestStringFloatingPointConversions.cpp

@@ -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)