mirror of
https://github.com/Naios/continuable.git
synced 2026-02-08 02:36:40 +08:00
more work
This commit is contained in:
parent
b3657abeaa
commit
f37f77bce6
@ -481,15 +481,20 @@ namespace detail
|
|||||||
multiple_result_maker<0, fu::identity<>, fu::identity<>, Args...>;
|
multiple_result_maker<0, fu::identity<>, fu::identity<>, Args...>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename Args>
|
||||||
|
struct multiple_when_all_chainer_t_make_result;
|
||||||
|
|
||||||
|
template<typename... Args>
|
||||||
|
struct multiple_when_all_chainer_t_make_result<fu::identity<Args...>>
|
||||||
|
{
|
||||||
|
typedef std::function<Continuable</*Args...*/>()> type;
|
||||||
|
|
||||||
|
// type create()
|
||||||
|
};
|
||||||
|
|
||||||
template <typename... _ATy, typename... _CTy>
|
template <typename... _ATy, typename... _CTy>
|
||||||
struct multiple_when_all_chainer_t<fu::identity<_ATy...>, fu::identity<_CTy...>>
|
struct multiple_when_all_chainer_t<fu::identity<_ATy...>, fu::identity<_CTy...>>
|
||||||
{
|
{
|
||||||
struct helper
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef typename functional_traits<_ATy...>::result_maker_of_t<_CTy...> result_maker;
|
typedef typename functional_traits<_ATy...>::result_maker_of_t<_CTy...> result_maker;
|
||||||
|
|
||||||
typedef typename result_maker::arguments_t arguments_t;
|
typedef typename result_maker::arguments_t arguments_t;
|
||||||
@ -499,10 +504,14 @@ namespace detail
|
|||||||
static std::size_t const size = result_maker::size;
|
static std::size_t const size = result_maker::size;
|
||||||
|
|
||||||
// Creates one continuable from multiple ones
|
// Creates one continuable from multiple ones
|
||||||
static auto make_when_all()
|
static auto make_when_all(_CTy&&... args)
|
||||||
-> int
|
-> typename multiple_when_all_chainer_t_make_result<arguments_t>::type
|
||||||
{
|
{
|
||||||
return 1;
|
return make_continuable([]()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
16
test.cpp
16
test.cpp
@ -345,6 +345,22 @@ int main(int /*argc*/, char** /*argv*/)
|
|||||||
>
|
>
|
||||||
>::result_maker::partial_results_t myres123345;
|
>::result_maker::partial_results_t myres123345;
|
||||||
|
|
||||||
|
detail::multiple_when_all_chainer_t<
|
||||||
|
fu::identity<>,
|
||||||
|
fu::identity<
|
||||||
|
std::function<Continuable<>()>,
|
||||||
|
std::function<Continuable<SpellCastResult>()>
|
||||||
|
>
|
||||||
|
>::make_when_all(
|
||||||
|
[]
|
||||||
|
{
|
||||||
|
return make_continuable();
|
||||||
|
},
|
||||||
|
[]
|
||||||
|
{
|
||||||
|
return CastSpellPromise(2);
|
||||||
|
});
|
||||||
|
|
||||||
std::cout << "ok" << std::endl;
|
std::cout << "ok" << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user