diff --git a/fluent/Continuable.h b/fluent/Continuable.h index 7fb0fd2..de4d19f 100644 --- a/fluent/Continuable.h +++ b/fluent/Continuable.h @@ -119,28 +119,31 @@ namespace detail return *this; } - template + template struct unary_chainer; - template - struct unary_chainer> + template + struct unary_chainer<_NextRTy, fu::identity<_NextATy...>> { template - static auto chain(_CTy&& functional, _ContinuableImpl&& me) - -> typename convert_void_to_continuable<_NewRTy>::type + static auto chain(_CTy&& /*functional*/, _ContinuableImpl&& /*me*/) + -> typename convert_void_to_continuable<_NextRTy>::type { - return typename convert_void_to_continuable<_NewRTy>::type(); - // _ContinuableImpl, Callback<_NewATy...>>(); + return convert_void_to_continuable<_NextRTy>::type(); + // _ContinuableImpl, Callback<_NextATy...>>(); } }; + template + using unary_chainer_t = unary_chainer< + fu::return_type_of_t::type>, + fu::argument_type_of_t::type>>; + template auto then(_CTy&& functional) - -> decltype(unary_chainer::type>>:: - chain(std::declval<_CTy>(), std::declval<_ContinuableImpl&&>())) + -> decltype(unary_chainer_t<_CTy>::chain(std::declval<_CTy>(), std::declval<_ContinuableImpl&&>)) { - return unary_chainer::type>>:: - chain(std::forward<_CTy>(functional), std::move(*this)); + return unary_chainer_t<_CTy>::chain(std::forward<_CTy>(), std::move(*this)); } /*