Преглед на файлове

test: boxed_int -> boxed_type

Michele Caini преди 2 години
родител
ревизия
5f73b2e4f2
променени са 8 файла, в които са добавени 25 реда и са изтрити 22 реда
  1. 0 1
      TODO
  2. 0 16
      test/entt/common/boxed_int.h
  3. 20 0
      test/entt/common/boxed_type.h
  4. 1 1
      test/entt/core/algorithm.cpp
  5. 1 1
      test/entt/core/iterator.cpp
  6. 1 1
      test/entt/entity/component.cpp
  7. 1 1
      test/entt/entity/group.cpp
  8. 1 1
      test/entt/entity/view.cpp

+ 0 - 1
TODO

@@ -27,6 +27,5 @@ TODO:
 * review assure conflicts check, hash doesn't fit the purpose maybe
 * allow to zero-sized versions (with non-regression tests)
 * auto type info data from types if present
-* boxed_int -> boxed_type with known specializations
 * sparse set sort_as should return the length to be a proper drop-in replacement for pack (then review registry destroy)
 * group review: use handler as base with protected members and arrays of common type (see view for further details)

+ 0 - 16
test/entt/common/boxed_int.h

@@ -1,16 +0,0 @@
-#ifndef ENTT_COMMON_BOXED_INT_H
-#define ENTT_COMMON_BOXED_INT_H
-
-namespace test {
-
-struct boxed_int {
-    int value{};
-};
-
-inline bool operator==(const boxed_int &lhs, const boxed_int &rhs) {
-    return lhs.value == rhs.value;
-}
-
-} // namespace test
-
-#endif

+ 20 - 0
test/entt/common/boxed_type.h

@@ -0,0 +1,20 @@
+#ifndef ENTT_COMMON_BOXED_TYPE_H
+#define ENTT_COMMON_BOXED_TYPE_H
+
+namespace test {
+
+template<typename Type>
+struct boxed_type {
+    Type value{};
+};
+
+template<typename Type>
+inline bool operator==(const boxed_type<Type> &lhs, const boxed_type<Type> &rhs) {
+    return lhs.value == rhs.value;
+}
+
+using boxed_int = boxed_type<int>;
+
+} // namespace test
+
+#endif

+ 1 - 1
test/entt/core/algorithm.cpp

@@ -3,7 +3,7 @@
 #include <vector>
 #include <gtest/gtest.h>
 #include <entt/core/algorithm.hpp>
-#include "../common/boxed_int.h"
+#include "../common/boxed_type.h"
 
 TEST(Algorithm, StdSort) {
     // well, I'm pretty sure it works, it's std::sort!!

+ 1 - 1
test/entt/core/iterator.cpp

@@ -3,7 +3,7 @@
 #include <vector>
 #include <gtest/gtest.h>
 #include <entt/core/iterator.hpp>
-#include "../common/boxed_int.h"
+#include "../common/boxed_type.h"
 
 TEST(InputIteratorPointer, Functionalities) {
     entt::input_iterator_pointer ptr{test::boxed_int{0}};

+ 1 - 1
test/entt/entity/component.cpp

@@ -1,7 +1,7 @@
 #include <gtest/gtest.h>
 #include <entt/config/config.h>
 #include <entt/entity/component.hpp>
-#include "../common/boxed_int.h"
+#include "../common/boxed_type.h"
 #include "../common/empty.h"
 #include "../common/non_movable.h"
 

+ 1 - 1
test/entt/entity/group.cpp

@@ -9,7 +9,7 @@
 #include <gtest/gtest.h>
 #include <entt/entity/group.hpp>
 #include <entt/entity/registry.hpp>
-#include "../common/boxed_int.h"
+#include "../common/boxed_type.h"
 #include "../common/config.h"
 #include "../common/empty.h"
 

+ 1 - 1
test/entt/entity/view.cpp

@@ -11,7 +11,7 @@
 #include <entt/entity/entity.hpp>
 #include <entt/entity/registry.hpp>
 #include <entt/entity/view.hpp>
-#include "../common/boxed_int.h"
+#include "../common/boxed_type.h"
 #include "../common/empty.h"
 #include "../common/pointer_stable.h"