fix result creator

This commit is contained in:
Denis Blank 2015-06-26 21:12:19 +02:00 committed by Naios
parent 160a5f9790
commit dad1432e93
2 changed files with 17 additions and 12 deletions

View File

@ -290,6 +290,8 @@ namespace detail
typedef fu::argument_type_of_t<corrected_t> arguments_t; typedef fu::argument_type_of_t<corrected_t> arguments_t;
typedef typename continuable_t::CallbackFunction callback_t; typedef typename continuable_t::CallbackFunction callback_t;
typedef fu::argument_type_of_t<callback_t> callback_arguments_t;
}; };
template<typename Left, typename Right> template<typename Left, typename Right>
@ -391,7 +393,7 @@ namespace detail
std::make_shared<typename std::decay<_CTy>::type>(std::forward<_CTy>(continuable)); std::make_shared<typename std::decay<_CTy>::type>(std::forward<_CTy>(continuable));
// Create a fake function which returns the value on invoke. // Create a fake function which returns the value on invoke.
return [shared_continuable](_ATy...) return [shared_continuable](_ATy&&...)
{ {
return std::move(*shared_continuable); return std::move(*shared_continuable);
}; };
@ -426,24 +428,21 @@ namespace detail
template<typename Current, typename... Rest> template<typename Current, typename... Rest>
struct multiple_result_maker; struct multiple_result_maker;
template<typename Previous, typename Last> template<typename Previous, typename Next>
struct multiple_result_maker<Previous, Last> struct multiple_result_maker<Previous, Next>
{ {
typedef typename concat_identities< typedef typename concat_identities<
Previous, typename unary_chainer_t<Last, _ATy...>::arguments_t Previous, typename unary_chainer_t<Next, _ATy...>::callback_arguments_t
>::type arguments_t; >::type arguments_t;
}; };
template<typename Previous, typename Next, typename... Rest> template<typename Previous, typename Next, typename... Rest>
struct multiple_result_maker<Previous, Next, Rest...> struct multiple_result_maker<Previous, Next, Rest...>
{ : public multiple_result_maker<
typedef typename multiple_result_maker<
typename concat_identities< typename concat_identities<
Previous, typename unary_chainer_t<Next, _ATy...>::arguments_t Previous, typename unary_chainer_t<Next, _ATy...>::callback_arguments_t
>::type, >::type,
Rest... Rest...> { };
>::arguments_t arguments_t;
};
}; };
} }

View File

@ -230,14 +230,20 @@ int main(int /*argc*/, char** /*argv*/)
//// Here we go //// Here we go
//entry(); //entry();
detail::unary_chainer_t<std::function<Continuable<bool>()>>::callback_arguments_t args213987;
detail::functional_traits<>::multiple_result_maker< detail::functional_traits<>::multiple_result_maker<
fu::identity<>, fu::identity<>,
std::function<Continuable<int>()>, std::function<Continuable<bool>()>,
std::function<Continuable<float>()> decltype(CastSpellPromise(2)),
decltype(TrivialPromise()),
std::function<Continuable<float, double>()>
>::arguments_t test282; >::arguments_t test282;
// static_assert(std::is_same<>::value,
detail::concat_identities<fu::identity<int, bool, char>, fu::identity<float, double>>::type myt; detail::concat_identities<fu::identity<int, bool, char>, fu::identity<float, double>>::type myt;
std::cout << "ok" << std::endl; std::cout << "ok" << std::endl;