Просмотр исходного кода

test: use iterators in the poly storage example

Michele Caini 4 лет назад
Родитель
Сommit
f116ad0594
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      test/entt/entity/poly_storage.cpp

+ 2 - 1
test/entt/entity/poly_storage.cpp

@@ -52,7 +52,8 @@ struct PolyStorage: entt::type_list_cat_t<
         }
 
         static void copy_to(const Type &self, entt::basic_registry<entity_type> &other) {
-            other.template insert<typename Type::value_type>(self.data(), self.data() + self.size(), self.raw(), self.raw() + self.size());
+            const entt::sparse_set &base = self;
+            other.template insert<typename Type::value_type>(base.rbegin(), base.rend(), self.rbegin(), self.rend());
         }
     };