test: use iterators in the poly storage example

This commit is contained in:
Michele Caini
2021-05-03 22:29:39 +02:00
parent e59d40834d
commit f116ad0594

View File

@@ -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());
}
};