From f95eecfcc6361584f5e2e05cd4d3706daaba88c5 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 13 May 2019 17:26:56 +0200 Subject: [PATCH] minor changes --- src/entt/entity/registry.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 1da5acfe9..f4478700c 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -232,7 +232,7 @@ class basic_registry { template inline auto swap(int, pool_type *cpool, const Entity entt, const std::size_t pos) - -> decltype(std::swap(cpool->get(entt), cpool->get(cpool->data()[pos])), void()) { + -> decltype(std::swap(cpool->get(entt), cpool->raw()[pos]), void()) { std::swap(cpool->get(entt), cpool->raw()[pos]); cpool->swap(cpool->sparse_set::get(entt), pos); } @@ -1366,10 +1366,11 @@ public: { if constexpr(sizeof...(Owned) == 0) { curr->construct(entity); + // suppress warnings + (void)this; } else { const auto pos = curr->owned++; - // useless this-> used to suppress a warning with gcc and clang - (this->swap(0, std::get *>(cpools), entity, pos), ...); + (swap(0, std::get *>(cpools), entity, pos), ...); } } });