1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-28 01:00:28 +03:00

Avoid using standard concepts

Turns out those are unimplemented in clang < 13, use custom code
instead.
This commit is contained in:
Maxime Coste 2021-11-25 22:09:01 +11:00
parent e49b99e269
commit 4122b64ecd

View File

@ -4,7 +4,6 @@
#include "assert.hh" #include "assert.hh"
#include <memory> #include <memory>
#include <concepts>
namespace Kakoune namespace Kakoune
{ {
@ -175,10 +174,9 @@ public:
{} {}
template<typename Target> template<typename Target>
requires requires (Target t, Args... a) { requires (not std::is_same_v<FunctionRef, std::remove_cvref_t<Target>> and
requires not std::is_same_v<FunctionRef, std::remove_cvref_t<Target>>; (std::is_void_v<Res> or
{ t(a...) } -> std::convertible_to<Res>; requires (Target t, Args... a, void(&func)(Res)) { func(t(a...)); }))
}
FunctionRef(Target&& target) FunctionRef(Target&& target)
: m_target{&target}, : m_target{&target},
m_invoker{[](void* target, Args... args) { m_invoker{[](void* target, Args... args) {