diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index 0eb215d62..f710e7f3f 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -227,7 +227,7 @@ public: */ template void each(Func func) { - const_cast(this)->each([&func](auto entity, const Component &... component) { + const_cast(this)->each([&func](entity_type entity, const Component &... component) { func(entity, const_cast(component)...); }); } @@ -497,7 +497,7 @@ public: */ template void each(Func func) { - const_cast(this)->each([&func](auto entity, const Component &... component) { + const_cast(this)->each([&func](entity_type entity, const Component &... component) { func(entity, const_cast(component)...); }); } @@ -752,7 +752,7 @@ public: */ template void each(Func func) { - const_cast(this)->each([&func](auto entity, const Component &component) { + const_cast(this)->each([&func](entity_type entity, const Component &component) { func(entity, const_cast(component)); }); } diff --git a/src/entt/signal/dispatcher.hpp b/src/entt/signal/dispatcher.hpp index b0aca97c2..746512007 100644 --- a/src/entt/signal/dispatcher.hpp +++ b/src/entt/signal/dispatcher.hpp @@ -41,7 +41,7 @@ class Dispatcher final { template struct SignalWrapper final: BaseSignalWrapper { void publish(std::size_t current) override { - for(auto &&event: events[current]) { + for(const auto &event: events[current]) { signal.publish(event); } @@ -79,7 +79,7 @@ class Dispatcher final { template SignalWrapper & wrapper() { - auto type = event_family::type(); + const auto type = event_family::type(); if(!(type < wrappers.size())) { wrappers.resize(type + 1); @@ -178,7 +178,7 @@ public: * to reduce at a minimum the time spent in the bodies of the listeners. */ void update() { - auto buf = buffer(mode); + const auto buf = buffer(mode); mode = !mode; for(auto &&wrapper: wrappers) { diff --git a/src/entt/signal/emitter.hpp b/src/entt/signal/emitter.hpp index 038529ed8..b13c4d227 100644 --- a/src/entt/signal/emitter.hpp +++ b/src/entt/signal/emitter.hpp @@ -124,7 +124,7 @@ class Emitter { template Handler & handler() noexcept { - std::size_t family = type(); + const std::size_t family = type(); if(!(family < handlers.size())) { handlers.resize(family+1); @@ -314,7 +314,7 @@ public: */ template bool empty() const noexcept { - std::size_t family = type(); + const std::size_t family = type(); return (!(family < handlers.size()) || !handlers[family] ||