mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
Some const additions
This commit is contained in:
parent
f35cc355e0
commit
c4a19efa55
@ -348,7 +348,7 @@ auto finalize_composition(
|
|||||||
auto composition = base::attorney::consume_data(std::move(continuation));
|
auto composition = base::attorney::consume_data(std::move(continuation));
|
||||||
|
|
||||||
// Merge all signature hints together
|
// Merge all signature hints together
|
||||||
constexpr auto signature = traits::unpack(composition, entry_merger{});
|
constexpr auto const signature = traits::unpack(composition, entry_merger{});
|
||||||
|
|
||||||
return base::attorney::create(
|
return base::attorney::create(
|
||||||
[ signature,
|
[ signature,
|
||||||
@ -357,11 +357,11 @@ auto finalize_composition(
|
|||||||
// std::pair<size_constant<?>, size_constant<?>>
|
// std::pair<size_constant<?>, size_constant<?>>
|
||||||
// ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
|
||||||
// Continuation pos Result pos
|
// Continuation pos Result pos
|
||||||
constexpr auto begin = std::make_pair(traits::size_constant_of<0>(),
|
constexpr auto const begin = std::make_pair(traits::size_constant_of<0>(),
|
||||||
traits::size_constant_of<0>());
|
traits::size_constant_of<0>());
|
||||||
constexpr auto pack = traits::identify<decltype(composition)>{};
|
constexpr auto const pack = traits::identify<decltype(composition)>{};
|
||||||
constexpr auto end = traits::pack_size_of(pack);
|
constexpr auto const end = traits::pack_size_of(pack);
|
||||||
auto condition = [=](auto pos) { return pos.first < end; };
|
auto const condition = [=](auto pos) { return pos.first < end; };
|
||||||
|
|
||||||
// Create the result submitter which caches all results and invokes
|
// Create the result submitter which caches all results and invokes
|
||||||
// the final callback upon completion.
|
// the final callback upon completion.
|
||||||
@ -374,11 +374,11 @@ auto finalize_composition(
|
|||||||
std::move(std::get<decltype(current.first)::value>(composition));
|
std::move(std::get<decltype(current.first)::value>(composition));
|
||||||
|
|
||||||
// This is the length of the arguments of the current continuable
|
// This is the length of the arguments of the current continuable
|
||||||
constexpr auto arg_size =
|
constexpr auto const arg_size =
|
||||||
traits::pack_size_of(hints::hint_of(traits::identity_of(entry)));
|
traits::pack_size_of(hints::hint_of(traits::identity_of(entry)));
|
||||||
|
|
||||||
// The next position in the result tuple
|
// The next position in the result tuple
|
||||||
constexpr auto next = current.second + arg_size;
|
constexpr auto const next = current.second + arg_size;
|
||||||
|
|
||||||
// Invoke the continuation with the associated submission callback
|
// Invoke the continuation with the associated submission callback
|
||||||
base::attorney::invoke_continuation(
|
base::attorney::invoke_continuation(
|
||||||
@ -457,7 +457,7 @@ auto finalize_composition(
|
|||||||
|
|
||||||
auto composition = base::attorney::consume_data(std::move(continuation));
|
auto composition = base::attorney::consume_data(std::move(continuation));
|
||||||
|
|
||||||
constexpr auto signature =
|
constexpr auto const signature =
|
||||||
traits::unpack(composition, determine_shared_result{});
|
traits::unpack(composition, determine_shared_result{});
|
||||||
|
|
||||||
return base::attorney::create(
|
return base::attorney::create(
|
||||||
|
|||||||
@ -120,7 +120,8 @@ public:
|
|||||||
template <typename Data, typename Annotation>
|
template <typename Data, typename Annotation>
|
||||||
auto as_future(continuable_base<Data, Annotation>&& continuable) {
|
auto as_future(continuable_base<Data, Annotation>&& continuable) {
|
||||||
// Create the promise which is able to supply the current arguments
|
// Create the promise which is able to supply the current arguments
|
||||||
auto hint = hints::hint_of(traits::identity_of(continuable));
|
constexpr auto const hint =
|
||||||
|
hints::hint_of(traits::identify<decltype(continuable)>{});
|
||||||
|
|
||||||
promise_callback<std::decay_t<decltype(hint)>> callback;
|
promise_callback<std::decay_t<decltype(hint)>> callback;
|
||||||
(void)hint;
|
(void)hint;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user