Przeglądaj źródła

test: minor changes

Michele Caini 11 miesięcy temu
rodzic
commit
cac3e4c62b
2 zmienionych plików z 4 dodań i 3 usunięć
  1. 1 0
      TODO
  2. 3 3
      test/entt/resource/resource.cpp

+ 1 - 0
TODO

@@ -36,3 +36,4 @@ TODO:
 * improve non-const allow cast with in-place switch
 * meta fixed_size could return the size directly if present
 * setup testbed workflow on the CI and review build process for testbed (i.e. tests first due to SDL)
+* type() -> info() for consistency (any, poly, sparse_set)

+ 3 - 3
test/entt/resource/resource.cpp

@@ -8,20 +8,20 @@
 struct base {
     virtual ~base() = default;
 
-    [[nodiscard]] virtual const entt::type_info &type() const noexcept {
+    [[nodiscard]] virtual const entt::type_info &info() const noexcept {
         return entt::type_id<base>();
     }
 };
 
 struct derived: base {
-    [[nodiscard]] const entt::type_info &type() const noexcept override {
+    [[nodiscard]] const entt::type_info &info() const noexcept override {
         return entt::type_id<derived>();
     }
 };
 
 template<typename Type, typename Other>
 entt::resource<Type> dynamic_resource_cast(const entt::resource<Other> &other) {
-    if(other->type() == entt::type_id<Type>()) {
+    if(other->info() == entt::type_id<Type>()) {
         return entt::resource<Type>{other, static_cast<Type &>(*other)};
     }