diff options
Diffstat (limited to 'src/lib/util/delegate.h')
-rw-r--r-- | src/lib/util/delegate.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/util/delegate.h b/src/lib/util/delegate.h index 169a48e2195..6f2c1feb0a6 100644 --- a/src/lib/util/delegate.h +++ b/src/lib/util/delegate.h @@ -585,7 +585,7 @@ private: static functoid_setter make_functoid_setter() { using unwrapped_type = std::remove_cv_t<std::remove_reference_t<T> >; - if constexpr (matching_non_const_call(&T::operator())) + if constexpr (matching_non_const_call(&unwrapped_type::operator())) { return [] (delegate &obj) @@ -596,7 +596,7 @@ private: std::any_cast<unwrapped_type>(&obj.m_functoid))); }; } - else if constexpr (matching_const_call(&T::operator())) + else if constexpr (matching_const_call(&unwrapped_type::operator())) { return [] (delegate &obj) @@ -643,6 +643,11 @@ public: m_set_functoid(*this); } + delegate(delegate &src) + : delegate(const_cast<delegate const &>(src)) + { + } + delegate(delegate &&src) : basetype(src.m_functoid.has_value() ? basetype() : std::move(src)) , m_functoid(std::move(src.m_functoid)) |