|
|
@@ -1404,12 +1404,12 @@ public:
|
|
|
handler->current.construct(entity);
|
|
|
}
|
|
|
} else {
|
|
|
- const auto curr = view<Owned..., Get...>(exclude<Exclude...>);
|
|
|
-
|
|
|
// we cannot iterate backwards because we want to leave behind valid entities in case of owned types
|
|
|
- std::for_each(std::make_reverse_iterator(curr.end()), std::make_reverse_iterator(curr.begin()), [cpools, handler](const auto entity) {
|
|
|
- if(const auto pos = handler->current; !(std::get<0>(cpools).index(entity) < ++handler->current)) {
|
|
|
- (std::get<pool_handler<std::decay_t<Owned>> &>(cpools).swap(std::get<pool_handler<std::decay_t<Owned>> &>(cpools).data()[pos], entity), ...);
|
|
|
+ std::for_each(std::get<0>(cpools).data(), std::get<0>(cpools).data() + std::get<0>(cpools).size(), [this, cpools, handler](const auto entity) {
|
|
|
+ if(has<std::decay_t<Owned>..., std::decay_t<Get>...>(entity) && !any<Exclude...>(entity)) {
|
|
|
+ if(const auto pos = handler->current; !(std::get<0>(cpools).index(entity) < ++handler->current)) {
|
|
|
+ (std::get<pool_handler<std::decay_t<Owned>> &>(cpools).swap(std::get<pool_handler<std::decay_t<Owned>> &>(cpools).data()[pos], entity), ...);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|