Ver Fonte

fixed error with clang

Michele Caini há 7 anos atrás
pai
commit
328f0c6da8
1 ficheiros alterados com 5 adições e 5 exclusões
  1. 5 5
      src/entt/entity/registry.hpp

+ 5 - 5
src/entt/entity/registry.hpp

@@ -1319,11 +1319,7 @@ public:
         other.pools.resize(pools.size());
         other.pools.resize(pools.size());
         other.sighs.resize(pools.size());
         other.sighs.resize(pools.size());
 
 
-        if constexpr(sizeof...(Component)) {
-            static_assert(std::conjunction_v<std::is_copy_constructible<Component>...>);
-            ((other.pools[type<Component>()] = assure<Component>().clone()), ...);
-            assert((other.pools[type<Component>()] && ...));
-        } else {
+        if constexpr(sizeof...(Component) == 0) {
             for(auto pos = pools.size(); pos; --pos) {
             for(auto pos = pools.size(); pos; --pos) {
                 auto &cpool = pools[pos-1];
                 auto &cpool = pools[pos-1];
 
 
@@ -1332,6 +1328,10 @@ public:
                     assert(other.pools[pos-1]);
                     assert(other.pools[pos-1]);
                 }
                 }
             };
             };
+        } else {
+            static_assert(std::conjunction_v<std::is_copy_constructible<Component>...>);
+            ((other.pools[type<Component>()] = assure<Component>().clone()), ...);
+            assert((other.pools[type<Component>()] && ...));
         }
         }
 
 
         other.next = next;
         other.next = next;