diff --git a/include/exec/any_sender_of.hpp b/include/exec/any_sender_of.hpp index 22793582c..0bad10044 100644 --- a/include/exec/any_sender_of.hpp +++ b/include/exec/any_sender_of.hpp @@ -567,8 +567,13 @@ namespace exec { } }; - template > - using __immovable_storage_t = __t<__immovable_storage<_VTable, _Allocator>>; + template < + class _VTable = __empty_vtable, + class _Allocator = std::allocator, + std::size_t _InlineSize = 3 * sizeof(void*), + std::size_t _Alignment = alignof(std::max_align_t)> + using __immovable_storage_t = + __t<__immovable_storage<_VTable, _Allocator, _InlineSize, _Alignment>>; template > using __unique_storage_t = __t<__storage<_VTable, _Allocator>>; @@ -791,7 +796,8 @@ namespace exec { } }; - using __immovable_operation_storage = __immovable_storage_t<__operation_vtable>; + using __immovable_operation_storage = + __immovable_storage_t<__operation_vtable, std::allocator, 6 * sizeof(void*)>; template using __receiver_ref = __mapply<__mbind_front<__q<__rec::__ref>, _Sigs>, _Queries>; @@ -1205,6 +1211,7 @@ namespace exec { template class any_scheduler { + // Add the required set_value_t() completions to the schedule-sender. using __schedule_completions = stdexec::__concat_completion_signatures< _Completions, stdexec::completion_signatures>; @@ -1216,10 +1223,11 @@ namespace exec { template struct __ret_equals_to { template - using __f = std::is_same<_Tag, decltype(__ret_fn(static_cast<_Sig>(nullptr)))>; + using __f = + stdexec::__mbool(nullptr))))>; }; - using schedule_sender_queries = stdexec::__minvoke< + using __schedule_sender_queries = stdexec::__minvoke< stdexec::__mremove_if< __ret_equals_to>>, decltype(_SenderQueries)...>; @@ -1238,7 +1246,7 @@ namespace exec { stdexec::get_completion_scheduler.template signature>; #endif using __schedule_sender = - stdexec::__mapply, schedule_sender_queries>; + stdexec::__mapply, __schedule_sender_queries>; using __scheduler_base = __any::__scheduler<__schedule_sender, queries<_SchedulerQueries...>>; diff --git a/include/exec/task.hpp b/include/exec/task.hpp index 32cb2e067..fea7287ed 100644 --- a/include/exec/task.hpp +++ b/include/exec/task.hpp @@ -38,10 +38,14 @@ namespace exec { namespace __task { using namespace stdexec; - using __any_scheduler = // - any_receiver_ref< // - completion_signatures // - >::any_sender<>::any_scheduler<>; + // The required set_value_t() scheduler-sender completion signature is added in + // any_receiver_ref::any_sender::any_scheduler. + using __any_scheduler_completions = + completion_signatures; + + using __any_scheduler = + any_receiver_ref<__any_scheduler_completions>::any_sender<>::any_scheduler<>; + static_assert(scheduler<__any_scheduler>); template