make senders conforming by giving them non-static connect and get_completion_signatures member fns
#1698
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ATTN: this PR drops support for senders with
staticmember functions forconnectandget_completion_signatures.problem
in stdexec today, many of the senders have non-conforming
connectandget_completion_signaturesmember functions. that's because stdexec must support C++20, which does not have C++23's "deducingthis" feature.instead,
stdexec::connecthas a non-conforming extension where it looks for a static member functionconnect, like:that is a problem because it would prevent senders from stdexec from being used with third party algorithms that are not hip to this subterfuge.
but defining
connectwith overloads like below comes with its own difficulties:if
opstate_tis some metafunction that computes an opstate type, now the compiler must compute the type twice to perform overload resolution. that's more expensive, and can even cause hard failures when things aren't properly constrained.solution
this pr introduces a portability macro for C++23's deducing
thisfeature. it can be used as follows:in C++23, this expands simply into:
but in C++20 is expands to:
now the sender has conforming signatures for
connect. behind the scenes,stdexec::connectchecks first for a staticstatic_connectmember and uses that if it finds one. otherwise, it calls theconnectmember function.