Browse Source

AK: Make AK::IsSame<T, U>::value a constexpr bool

It being an enum value was preventing it from being used without `!!` in
requires clauses (bool also makes more sense anyway).
AnotherTest 4 years ago
parent
commit
ad646420dd
1 changed files with 2 additions and 6 deletions
  1. 2 6
      AK/StdLibExtras.h

+ 2 - 6
AK/StdLibExtras.h

@@ -276,16 +276,12 @@ struct RemovePointer<T* const volatile> {
 
 template<typename T, typename U>
 struct IsSame {
-    enum {
-        value = 0
-    };
+    static constexpr bool value = false;
 };
 
 template<typename T>
 struct IsSame<T, T> {
-    enum {
-        value = 1
-    };
+    static constexpr bool value = true;
 };
 
 template<bool condition, class TrueType, class FalseType>