diff --git a/src/entt/signal/sigh.hpp b/src/entt/signal/sigh.hpp index a3193680e..ffd220dd3 100644 --- a/src/entt/signal/sigh.hpp +++ b/src/entt/signal/sigh.hpp @@ -3,7 +3,6 @@ #include #include -#include #include #include #include @@ -362,7 +361,7 @@ private: template class sink> { using signal_type = sigh; - using difference_type = typename std::iterator_traits::difference_type; + using difference_type = typename signal_type::container_type::difference_type; template static void release(Type value_or_instance, void *signal) { @@ -406,7 +405,7 @@ public: const auto it = std::find(calls.cbegin(), calls.cend(), std::move(call)); sink other{*this}; - other.offset = std::distance(it, calls.cend()); + other.offset = calls.cend() - it; return other; } @@ -427,7 +426,7 @@ public: const auto it = std::find(calls.cbegin(), calls.cend(), std::move(call)); sink other{*this}; - other.offset = std::distance(it, calls.cend()); + other.offset = calls.cend() - it; return other; } @@ -460,7 +459,7 @@ public: return delegate.data() == value_or_instance; }); - other.offset = std::distance(it, calls.cend()); + other.offset = calls.cend() - it; } return other;