瀏覽代碼

sparse_set: minor changes

Michele Caini 5 年之前
父節點
當前提交
c9f47ed89a
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/entt/entity/sparse_set.hpp

+ 4 - 4
src/entt/entity/sparse_set.hpp

@@ -386,7 +386,7 @@ public:
      */
      */
     void emplace(const entity_type entt) {
     void emplace(const entity_type entt) {
         ENTT_ASSERT(!contains(entt));
         ENTT_ASSERT(!contains(entt));
-        assure(page(entt))[offset(entt)] = entity_type(static_cast<typename traits_type::entity_type>(packed.size()));
+        assure(page(entt))[offset(entt)] = entity_type{static_cast<typename traits_type::entity_type>(packed.size())};
         packed.push_back(entt);
         packed.push_back(entt);
     }
     }
 
 
@@ -411,7 +411,7 @@ public:
         while(first != last) {
         while(first != last) {
             const auto entt = *(first++);
             const auto entt = *(first++);
             ENTT_ASSERT(!contains(entt));
             ENTT_ASSERT(!contains(entt));
-            assure(page(entt))[offset(entt)] = entity_type(next++);
+            assure(page(entt))[offset(entt)] = entity_type{next++};
         }
         }
     }
     }
 
 
@@ -505,7 +505,7 @@ public:
         algo(from, to, std::move(compare), std::forward<Args>(args)...);
         algo(from, to, std::move(compare), std::forward<Args>(args)...);
 
 
         for(size_type pos = skip, end = skip+length; pos < end; ++pos) {
         for(size_type pos = skip, end = skip+length; pos < end; ++pos) {
-            sparse[page(packed[pos])][offset(packed[pos])] = entity_type(static_cast<typename traits_type::entity_type>(pos));
+            sparse[page(packed[pos])][offset(packed[pos])] = entity_type{static_cast<typename traits_type::entity_type>(pos)};
         }
         }
     }
     }
 
 
@@ -554,7 +554,7 @@ public:
 
 
             while(curr != next) {
             while(curr != next) {
                 apply(packed[curr], packed[next]);
                 apply(packed[curr], packed[next]);
-                sparse[page(packed[curr])][offset(packed[curr])] = entity_type(static_cast<typename traits_type::entity_type>(curr));
+                sparse[page(packed[curr])][offset(packed[curr])] = entity_type{static_cast<typename traits_type::entity_type>(curr)};
 
 
                 curr = next;
                 curr = next;
                 next = index(packed[curr]);
                 next = index(packed[curr]);