mirror of
https://github.com/Naios/continuable.git
synced 2025-12-08 01:36:46 +08:00
fix result creator
This commit is contained in:
parent
160a5f9790
commit
dad1432e93
@ -290,6 +290,8 @@ namespace detail
|
||||
typedef fu::argument_type_of_t<corrected_t> arguments_t;
|
||||
|
||||
typedef typename continuable_t::CallbackFunction callback_t;
|
||||
|
||||
typedef fu::argument_type_of_t<callback_t> callback_arguments_t;
|
||||
};
|
||||
|
||||
template<typename Left, typename Right>
|
||||
@ -391,7 +393,7 @@ namespace detail
|
||||
std::make_shared<typename std::decay<_CTy>::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<typename Current, typename... Rest>
|
||||
struct multiple_result_maker;
|
||||
|
||||
template<typename Previous, typename Last>
|
||||
struct multiple_result_maker<Previous, Last>
|
||||
template<typename Previous, typename Next>
|
||||
struct multiple_result_maker<Previous, Next>
|
||||
{
|
||||
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;
|
||||
};
|
||||
|
||||
template<typename Previous, typename Next, typename... Rest>
|
||||
struct multiple_result_maker<Previous, Next, Rest...>
|
||||
{
|
||||
typedef typename multiple_result_maker<
|
||||
: public multiple_result_maker<
|
||||
typename concat_identities<
|
||||
Previous, typename unary_chainer_t<Next, _ATy...>::arguments_t
|
||||
Previous, typename unary_chainer_t<Next, _ATy...>::callback_arguments_t
|
||||
>::type,
|
||||
Rest...
|
||||
>::arguments_t arguments_t;
|
||||
};
|
||||
Rest...> { };
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
10
test.cpp
10
test.cpp
@ -230,14 +230,20 @@ int main(int /*argc*/, char** /*argv*/)
|
||||
//// Here we go
|
||||
//entry();
|
||||
|
||||
detail::unary_chainer_t<std::function<Continuable<bool>()>>::callback_arguments_t args213987;
|
||||
|
||||
detail::functional_traits<>::multiple_result_maker<
|
||||
fu::identity<>,
|
||||
|
||||
std::function<Continuable<int>()>,
|
||||
std::function<Continuable<float>()>
|
||||
std::function<Continuable<bool>()>,
|
||||
decltype(CastSpellPromise(2)),
|
||||
decltype(TrivialPromise()),
|
||||
std::function<Continuable<float, double>()>
|
||||
|
||||
>::arguments_t test282;
|
||||
|
||||
// static_assert(std::is_same<>::value,
|
||||
|
||||
detail::concat_identities<fu::identity<int, bool, char>, fu::identity<float, double>>::type myt;
|
||||
|
||||
std::cout << "ok" << std::endl;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user