Przeglądaj źródła

snapshot: use component_traits instead of is_empty_v

Michele Caini 2 lat temu
rodzic
commit
fc8eebf367
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      src/entt/entity/snapshot.hpp

+ 2 - 2
src/entt/entity/snapshot.hpp

@@ -250,7 +250,7 @@ public:
 
 
         archive(length);
         archive(length);
 
 
-        if constexpr(std::is_empty_v<Component>) {
+        if constexpr(Registry::template storage_for_type<Component>::traits_type::page_size == 0u) {
             while(length--) {
             while(length--) {
                 archive(entt);
                 archive(entt);
                 const auto entity = storage.contains(entt) ? entt : storage.emplace(entt);
                 const auto entity = storage.contains(entt) ? entt : storage.emplace(entt);
@@ -426,7 +426,7 @@ class basic_continuous_loader {
 
 
         archive(length);
         archive(length);
 
 
-        if constexpr(std::is_empty_v<Component>) {
+        if constexpr(Registry::template storage_for_type<Component>::traits_type::page_size == 0u) {
             while(length--) {
             while(length--) {
                 archive(entt);
                 archive(entt);
                 restore(entt);
                 restore(entt);