mirror of
https://github.com/Naios/continuable.git
synced 2026-02-09 11:16:40 +08:00
add size
This commit is contained in:
parent
9d420817b0
commit
4caa154aa5
@ -434,20 +434,23 @@ namespace detail
|
|||||||
return remove_void_trait(box_continuable_trait(std::forward<_CTy>(functional)));
|
return remove_void_trait(box_continuable_trait(std::forward<_CTy>(functional)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Args, typename Pack, typename... Rest>
|
template<size_t Count, typename Args, typename Pack, typename... Rest>
|
||||||
struct multiple_result_maker;
|
struct multiple_result_maker;
|
||||||
|
|
||||||
template<typename... Args, typename... Pack>
|
template<size_t Count, typename... Args, typename... Pack>
|
||||||
struct multiple_result_maker<fu::identity<Args...>, fu::identity<Pack...>>
|
struct multiple_result_maker<Count, fu::identity<Args...>, fu::identity<Pack...>>
|
||||||
{
|
{
|
||||||
typedef fu::identity<Args...> arguments_t;
|
typedef fu::identity<Args...> arguments_t;
|
||||||
|
|
||||||
typedef fu::identity<Pack...> arguments_storage_t;
|
typedef fu::identity<Pack...> arguments_storage_t;
|
||||||
|
|
||||||
|
static size_t const size = Count;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Args, typename Pack, typename Next>
|
template<size_t Count, typename Args, typename Pack, typename Next>
|
||||||
struct multiple_result_maker<Args, Pack, Next>
|
struct multiple_result_maker<Count, Args, Pack, Next>
|
||||||
: public multiple_result_maker<
|
: public multiple_result_maker<
|
||||||
|
Count + 1,
|
||||||
typename concat_identities<
|
typename concat_identities<
|
||||||
Args,
|
Args,
|
||||||
typename unary_chainer_t<Next, _ATy...>::callback_arguments_t
|
typename unary_chainer_t<Next, _ATy...>::callback_arguments_t
|
||||||
@ -458,9 +461,10 @@ namespace detail
|
|||||||
>::type
|
>::type
|
||||||
> { };
|
> { };
|
||||||
|
|
||||||
template<typename Args, typename Pack, typename Next, typename... Rest>
|
template<size_t Count, typename Args, typename Pack, typename Next, typename... Rest>
|
||||||
struct multiple_result_maker<Args, Pack, Next, Rest...>
|
struct multiple_result_maker<Count, Args, Pack, Next, Rest...>
|
||||||
: public multiple_result_maker<
|
: public multiple_result_maker<
|
||||||
|
Count + 1,
|
||||||
typename concat_identities<
|
typename concat_identities<
|
||||||
Args,
|
Args,
|
||||||
typename unary_chainer_t<Next, _ATy...>::callback_arguments_t
|
typename unary_chainer_t<Next, _ATy...>::callback_arguments_t
|
||||||
@ -474,7 +478,7 @@ namespace detail
|
|||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
using result_maker_of_t =
|
using result_maker_of_t =
|
||||||
multiple_result_maker<fu::identity<>, fu::identity<>, Args...>;
|
multiple_result_maker<0, fu::identity<>, fu::identity<>, Args...>;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
test.cpp
1
test.cpp
@ -245,6 +245,7 @@ int main(int /*argc*/, char** /*argv*/)
|
|||||||
|
|
||||||
maker::arguments_t test282_args;
|
maker::arguments_t test282_args;
|
||||||
maker::arguments_storage_t test282_pack;
|
maker::arguments_storage_t test282_pack;
|
||||||
|
auto test282_size = maker::size;
|
||||||
|
|
||||||
// static_assert(std::is_same<>::value,
|
// static_assert(std::is_same<>::value,
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user