Explorar o código

test: refine throwing_type (prepare to get rid of static variables)

Michele Caini %!s(int64=2) %!d(string=hai) anos
pai
achega
3d9da1dbce
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      test/entt/common/throwing_type.hpp

+ 5 - 1
test/entt/common/throwing_type.hpp

@@ -31,7 +31,7 @@ public:
         return *this;
     }
 
-    operator int() const {
+    int get() const {
         return data;
     }
 
@@ -41,6 +41,10 @@ private:
     int data{};
 };
 
+inline bool operator==(const throwing_type &lhs, const throwing_type &rhs) {
+    return lhs.get() == rhs.get();
+}
+
 } // namespace test
 
 #endif