diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 5d7ab1db6..5d43756bd 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -106,7 +106,6 @@ class Registry { template Pool & pool() noexcept { - assert(managed()); return const_cast &>(const_cast(this)->pool()); } @@ -417,7 +416,6 @@ public: } tags[ttype].reset(new Attaching{entity, { std::forward(args)... }}); - tags[ttype]->entity = entity; return static_cast *>(tags[ttype].get())->tag; } diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index 15ba82e64..b1f564340 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -203,9 +203,9 @@ public: * @param func A valid function object. */ template - void each(Func &&func) { + void each(Func func) { for(auto entity: *this) { - std::forward(func)(entity, get(entity)...); + func(entity, get(entity)...); } } @@ -225,9 +225,9 @@ public: * @param func A valid function object. */ template - void each(Func &&func) const { + void each(Func func) const { for(auto entity: *this) { - std::forward(func)(entity, get(entity)...); + func(entity, get(entity)...); } } @@ -472,9 +472,9 @@ public: * @param func A valid function object. */ template - void each(Func &&func) { + void each(Func func) { for(auto entity: *this) { - std::forward(func)(entity, get(entity), get(entity)...); + func(entity, get(entity), get(entity)...); } } @@ -494,9 +494,9 @@ public: * @param func A valid function object. */ template - void each(Func &&func) const { + void each(Func func) const { for(auto entity: *this) { - std::forward(func)(entity, get(entity), get(entity)...); + func(entity, get(entity), get(entity)...); } } @@ -727,9 +727,9 @@ public: * @param func A valid function object. */ template - void each(Func &&func) { + void each(Func func) { for(auto entity: *this) { - std::forward(func)(entity, get(entity)); + func(entity, get(entity)); } } @@ -748,9 +748,9 @@ public: * @param func A valid function object. */ template - void each(Func &&func) const { + void each(Func func) const { for(auto entity: *this) { - std::forward(func)(entity, get(entity)); + func(entity, get(entity)); } } diff --git a/src/entt/process/scheduler.hpp b/src/entt/process/scheduler.hpp index 9c78a5678..0b4897484 100644 --- a/src/entt/process/scheduler.hpp +++ b/src/entt/process/scheduler.hpp @@ -114,7 +114,7 @@ class Scheduler final { using Proc = typename decltype(next)::type; if(handler) { - auto proc = typename ProcessHandler::instance_type{ new Proc{std::forward(args)...}, &Scheduler::deleter }; + auto proc = typename ProcessHandler::instance_type{new Proc{std::forward(args)...}, &Scheduler::deleter}; handler->next.reset(new ProcessHandler{std::move(proc), &Scheduler::update, &Scheduler::abort, nullptr}); handler = handler->next.get(); } @@ -197,7 +197,7 @@ public: auto attach(Args&&... args) { static_assert(std::is_base_of, Proc>::value, "!"); - auto proc = typename ProcessHandler::instance_type{ new Proc{std::forward(args)...}, &Scheduler::deleter }; + auto proc = typename ProcessHandler::instance_type{new Proc{std::forward(args)...}, &Scheduler::deleter}; ProcessHandler handler{std::move(proc), &Scheduler::update, &Scheduler::abort, nullptr}; handlers.push_back(std::move(handler));