`just` senders are move/copy constructible but not assignable
msimberg opened this issue · 0 comments
msimberg commented
See https://godbolt.org/z/GW7cfea31 for a reproducer. I would expect them to be assignable if they're copy/move constructible. The source seems to be __make_tuple
(
stdexec/include/stdexec/__detail/__basic_sender.hpp
Lines 612 to 653 in 869fb2a
namespace { | |
constexpr auto __make_tuple = // | |
[]<class _Tag, class... _Captures>(_Tag, _Captures&&... __captures) { | |
return [=]<class _Cvref, class _Fun>(_Cvref __cvref, _Fun && __fun) mutable // | |
noexcept(__nothrow_callable<_Fun, _Tag, __minvoke<_Captures, _Cvref>...>) // | |
-> decltype(__f<__call_result_t<_Fun, _Tag, __minvoke<_Captures, _Cvref>...>>()) | |
requires __callable<_Fun, _Tag, __minvoke<_Captures, _Cvref>...> | |
{ | |
return ((_Fun&&) __fun)( | |
_Tag(), const_cast<__minvoke<_Captures, _Cvref>&&>(__captures.__value)...); | |
}; | |
}; | |
} // anonymous namespace | |
template <class _Tag> | |
template <class _Data, class... _Child> | |
constexpr auto __make_sexpr_t<_Tag>::operator()(_Data __data, _Child... __child) const { | |
return __sexpr{__make_tuple(_Tag(), __detail::__mbc(__data), __detail::__mbc(__child)...)}; | |
} | |
#else | |
// Anonymous namespace here is to avoid symbol name collisions with the | |
// lambda functions returned by __make_tuple. | |
namespace { | |
constexpr auto __make_tuple = // | |
[]<class _Tag, class... _Captures>(_Tag, _Captures&&... __captures) { | |
return [... __captures = (_Captures&&) __captures]<class _Cvref, class _Fun>( | |
_Cvref, _Fun && __fun) mutable // | |
noexcept(__nothrow_callable<_Fun, _Tag, __minvoke<_Cvref, _Captures>...>) // | |
-> __call_result_t<_Fun, _Tag, __minvoke<_Cvref, _Captures>...> | |
requires __callable<_Fun, _Tag, __minvoke<_Cvref, _Captures>...> | |
{ | |
return ((_Fun&&) __fun)( | |
_Tag(), const_cast<__minvoke<_Cvref, _Captures>&&>(__captures)...); | |
}; | |
}; | |
} // anonymous namespace | |
template <class _Tag> | |
template <class _Data, class... _Child> | |
constexpr auto __make_sexpr_t<_Tag>::operator()(_Data __data, _Child... __child) const { | |
return __sexpr{__make_tuple(_Tag(), (_Data&&) __data, (_Child&&) __child...)}; | |
}; |
just
sender non-assignable. Is this expected or intentional? Does __make_tuple
need to be implemented that way?