diff --git a/src/utils.hh b/src/utils.hh index 9d6bace5..21ed5fd3 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -4,7 +4,6 @@ #include "assert.hh" #include -#include namespace Kakoune { @@ -175,10 +174,9 @@ public: {} template - requires requires (Target t, Args... a) { - requires not std::is_same_v>; - { t(a...) } -> std::convertible_to; - } + requires (not std::is_same_v> and + (std::is_void_v or + requires (Target t, Args... a, void(&func)(Res)) { func(t(a...)); })) FunctionRef(Target&& target) : m_target{&target}, m_invoker{[](void* target, Args... args) {