From 30f4907e596ba6f154fc513eb92c3a74ba720eb0 Mon Sep 17 00:00:00 2001 From: Naios Date: Fri, 26 Jun 2015 20:48:53 +0200 Subject: [PATCH] some work on identity chaining --- include/Continuable.h | 29 ++++++++++------------------- test.cpp | 7 +++++-- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/include/Continuable.h b/include/Continuable.h index 560feba..f62eea1 100644 --- a/include/Continuable.h +++ b/include/Continuable.h @@ -277,7 +277,6 @@ inline auto make_continuable() namespace detail { - /// Helper trait for unary chains like `Continuable::then` template struct unary_chainer_t @@ -424,34 +423,26 @@ namespace detail return remove_void_trait(box_continuable_trait(std::forward<_CTy>(functional))); } - template + template struct multiple_result_maker; - template - struct multiple_result_maker, Last> + template + struct multiple_result_maker { - // typedef decltype(correct(std::declval::type>())) corrected_t; - - /* typedef typename concat_identities< - fu::identity, - fu::argument_type_of_t - > type; - */ + Previous, typename unary_chainer_t::arguments_t + >::type arguments_t; }; - template - struct multiple_result_maker, First, Rest...> + template + struct multiple_result_maker { - /* typedef typename multiple_result_maker< typename concat_identities< - fu::identity, - fu::argument_type_of_t - >, + Previous, typename unary_chainer_t::arguments_t + >::type, Rest... - > type; - */ + >::arguments_t arguments_t; }; }; } diff --git a/test.cpp b/test.cpp index 9494b89..0eace95 100644 --- a/test.cpp +++ b/test.cpp @@ -233,9 +233,12 @@ int main(int /*argc*/, char** /*argv*/) detail::functional_traits<>::multiple_result_maker< fu::identity<>, - std::function> + std::function()>, + std::function()> - > test282; + >::arguments_t test282; + + detail::concat_identities, fu::identity>::type myt; std::cout << "ok" << std::endl; return 0;