Просмотр исходного кода

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

Michele Caini 2 лет назад
Родитель
Сommit
3d9da1dbce
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      test/entt/common/throwing_type.hpp

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

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