mirror of
https://github.com/Naios/continuable.git
synced 2025-12-08 01:36:46 +08:00
save
This commit is contained in:
parent
d03b952c8a
commit
5637ebe60d
@ -294,6 +294,10 @@ namespace detail
|
||||
typedef fu::argument_type_of_t<callback_t> callback_arguments_t;
|
||||
};
|
||||
|
||||
/// Helper trait for multiple chains like `Continuable::all`
|
||||
template <typename...>
|
||||
struct multiple_when_all_chainer_t;
|
||||
|
||||
template<typename Left, typename Right>
|
||||
struct concat_identities;
|
||||
|
||||
@ -312,12 +316,6 @@ namespace detail
|
||||
typedef std::tuple<Args...> type;
|
||||
};
|
||||
|
||||
template<typename... _CTy>
|
||||
struct multiple_chainer_test
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
template<typename _ATy>
|
||||
struct void_wrap_trait;
|
||||
|
||||
@ -482,6 +480,31 @@ namespace detail
|
||||
using result_maker_of_t =
|
||||
multiple_result_maker<0, fu::identity<>, fu::identity<>, Args...>;
|
||||
};
|
||||
|
||||
|
||||
|
||||
template <typename... _ATy, typename... _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 result_maker::arguments_t arguments_t;
|
||||
|
||||
typedef typename result_maker::partial_results_t partial_results_t;
|
||||
|
||||
static std::size_t const size = result_maker::size;
|
||||
|
||||
// Creates one continuable from multiple ones
|
||||
static auto make_when_all()
|
||||
-> int
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // _CONTINUABLE_H_
|
||||
|
||||
8
test.cpp
8
test.cpp
@ -337,6 +337,14 @@ int main(int /*argc*/, char** /*argv*/)
|
||||
fu::sequence_generator<2>::type seqtype;
|
||||
fu::sequence_generator<1>::type zero_seqtype;
|
||||
|
||||
detail::multiple_when_all_chainer_t<
|
||||
fu::identity<>,
|
||||
fu::identity<
|
||||
std::function<Continuable<>()>,
|
||||
std::function<Continuable<std::string>()>
|
||||
>
|
||||
>::result_maker::partial_results_t myres123345;
|
||||
|
||||
std::cout << "ok" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user