From 9374ef4055bffcdd6e3da53ecf7e964725d7475a Mon Sep 17 00:00:00 2001 From: Denis Blank Date: Wed, 1 Jul 2015 20:26:59 +0200 Subject: [PATCH] some changes --- include/Continuable.h | 54 +++++++++++++++++++++++++++++++++++-------- test.cpp | 10 +++++--- 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/include/Continuable.h b/include/Continuable.h index bc556b3..6df8baf 100644 --- a/include/Continuable.h +++ b/include/Continuable.h @@ -303,6 +303,15 @@ namespace detail typedef fu::identity type; }; + template + struct concat_identities_as_pack; + + template + struct concat_identities_as_pack, fu::identity> + { + typedef fu::identity> type; + }; + template struct multiple_chainer_test { @@ -425,24 +434,49 @@ namespace detail return remove_void_trait(box_continuable_trait(std::forward<_CTy>(functional))); } - template + template struct multiple_result_maker; - template - struct multiple_result_maker + template + struct multiple_result_maker, fu::identity> { - typedef typename concat_identities< - Previous, typename unary_chainer_t::callback_arguments_t - >::type arguments_t; + typedef fu::identity arguments_t; + + typedef fu::identity arguments_storage_t; }; - template - struct multiple_result_maker + template + struct multiple_result_maker : public multiple_result_maker< typename concat_identities< - Previous, typename unary_chainer_t::callback_arguments_t + Args, + typename unary_chainer_t::callback_arguments_t >::type, - Rest...> { }; + typename concat_identities_as_pack< + Pack, + // typename wrap_in_tuple< + typename unary_chainer_t::callback_arguments_t + // >::type + >::type + > { } + + template + struct multiple_result_maker + : public multiple_result_maker< + typename concat_identities< + Args, + typename unary_chainer_t::callback_arguments_t + >::type, + typename concat_identities_as_pack < + Pack, + typename unary_chainer_t::callback_arguments_t + >::type, + Rest... + > { }; + + template + using result_maker_of_t = + multiple_result_maker, fu::identity<>, Args...>; }; } diff --git a/test.cpp b/test.cpp index 43280a3..9224fc6 100644 --- a/test.cpp +++ b/test.cpp @@ -232,20 +232,24 @@ int main(int /*argc*/, char** /*argv*/) detail::unary_chainer_t()>>::callback_arguments_t args213987; - detail::functional_traits<>::multiple_result_maker< - fu::identity<>, + typedef detail::result_maker_of_t< std::function()>, decltype(CastSpellPromise(2)), decltype(TrivialPromise()), std::function()> - >::arguments_t test282; + > maker; + + maker::arguments_t test282_args; + maker::arguments_storage_t test282_pack; // static_assert(std::is_same<>::value, detail::concat_identities, fu::identity>::type myt; + std::tuple> tup; + std::cout << "ok" << std::endl; return 0; }