diff --git a/include/Continuable.h b/include/Continuable.h index f62eea1..bc556b3 100644 --- a/include/Continuable.h +++ b/include/Continuable.h @@ -290,6 +290,8 @@ namespace detail typedef fu::argument_type_of_t arguments_t; typedef typename continuable_t::CallbackFunction callback_t; + + typedef fu::argument_type_of_t callback_arguments_t; }; template @@ -391,7 +393,7 @@ namespace detail std::make_shared::type>(std::forward<_CTy>(continuable)); // Create a fake function which returns the value on invoke. - return [shared_continuable](_ATy...) + return [shared_continuable](_ATy&&...) { return std::move(*shared_continuable); }; @@ -426,24 +428,21 @@ namespace detail template struct multiple_result_maker; - template - struct multiple_result_maker + template + struct multiple_result_maker { typedef typename concat_identities< - Previous, typename unary_chainer_t::arguments_t + Previous, typename unary_chainer_t::callback_arguments_t >::type arguments_t; }; template struct multiple_result_maker - { - typedef typename multiple_result_maker< + : public multiple_result_maker< typename concat_identities< - Previous, typename unary_chainer_t::arguments_t + Previous, typename unary_chainer_t::callback_arguments_t >::type, - Rest... - >::arguments_t arguments_t; - }; + Rest...> { }; }; } diff --git a/test.cpp b/test.cpp index 0eace95..43280a3 100644 --- a/test.cpp +++ b/test.cpp @@ -230,14 +230,20 @@ int main(int /*argc*/, char** /*argv*/) //// Here we go //entry(); + detail::unary_chainer_t()>>::callback_arguments_t args213987; + detail::functional_traits<>::multiple_result_maker< fu::identity<>, - std::function()>, - std::function()> + std::function()>, + decltype(CastSpellPromise(2)), + decltype(TrivialPromise()), + std::function()> >::arguments_t test282; + // static_assert(std::is_same<>::value, + detail::concat_identities, fu::identity>::type myt; std::cout << "ok" << std::endl;