From 716f1f967a2d2fc22390b05d23c62c444f68ebff Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 25 Nov 2021 22:30:02 +1100 Subject: [PATCH] Clang is still unhappy, trying another approach with defining my own concept --- src/utils.hh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/utils.hh b/src/utils.hh index 21ed5fd3..7b7fd2d7 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -162,6 +162,9 @@ auto to_underlying(E value) template class FunctionRef; +template +concept ConvertibleTo = std::is_convertible_v; + template class FunctionRef { @@ -174,9 +177,10 @@ public: {} template - requires (not std::is_same_v> and - (std::is_void_v or - requires (Target t, Args... a, void(&func)(Res)) { func(t(a...)); })) + requires requires (Target t, Args... a) { + requires not std::is_same_v>; + { t(a...) } -> ConvertibleTo; + } FunctionRef(Target&& target) : m_target{&target}, m_invoker{[](void* target, Args... args) {