From e9ab01b894e64058aaa5c3bd9d36a7ebb1dcd9e1 Mon Sep 17 00:00:00 2001 From: q66 Date: Sun, 7 Jun 2015 00:03:06 +0100 Subject: [PATCH] function cleanup --- octa/functional.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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;