diff --git a/octa/functional.h b/octa/functional.h index eedc0eb..74960bc 100644 --- a/octa/functional.h +++ b/octa/functional.h @@ -505,9 +505,6 @@ namespace detail { static constexpr bool value = false; }; - struct Empty { - }; - template T func_to_functor(T &&f) { return octa::forward(f); @@ -527,11 +524,13 @@ namespace detail { template struct IsValidFunctor { + struct Nat {}; + template static decltype(func_to_functor(octa::declval()) (octa::declval()...)) test(U *); template - static Empty test(...); + static Nat test(...); static constexpr bool value = octa::IsConvertible< decltype(test(nullptr)), R @@ -555,9 +554,8 @@ struct Function: octa::detail::FunctionBase { template Function(T f, EnableIf< - octa::detail::IsValidFunctor::value, - octa::detail::Empty - > = octa::detail::Empty()) { + octa::detail::IsValidFunctor::value, bool + > = true) { if (func_is_null(f)) { init_empty(); return;