sigh: slightly reduce instantiations

This commit is contained in:
Michele Caini
2022-04-04 09:46:00 +02:00
parent 6b53b509fa
commit 6e1a774921

View File

@@ -3,7 +3,6 @@
#include <algorithm>
#include <functional>
#include <iterator>
#include <type_traits>
#include <utility>
#include <vector>
@@ -362,7 +361,7 @@ private:
template<typename Ret, typename... Args, typename Allocator>
class sink<sigh<Ret(Args...), Allocator>> {
using signal_type = sigh<Ret(Args...), Allocator>;
using difference_type = typename std::iterator_traits<typename decltype(signal_type::calls)::iterator>::difference_type;
using difference_type = typename signal_type::container_type::difference_type;
template<auto Candidate, typename Type>
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;