implement `indeterminate_domain` from P3826R2
Description
my focus recently has been shoring up std::execution's algorithm customization mechanism ahead of the C++26 release. in that mechanism, the domains on which an operation starts and completes are used to dispatch to the correct algorithm implementation.
a thorny issue has been: what to do when an operation can complete on domain A or domain B? that can sometimes happen. without the ability to pick one domain, the customization mechanism gives up, and no custom implementation is used.
during last week's committee meeting i had a happy thought. most domains do not customize most algorithms. it shouldn't be an error if then(sndr, fn) can complete on domain A or domain B if neither domain customizes the then algorithm.
this led me to the idea of using a set of domains as a domain. indeterminate_domain<A, B> captures the fact that a sender completes on one of two domains.
dispatching with indeterminate_domain<A, B> proceeds as follows:
- compute the types of
D().transform_sender(set_value, sndr, env)forDinA,B, anddefault_domain. - if the 3 transformed sender types are the same, then we use the
default_domaintransform. - otherwise, it is a hard error.
Checklist
- [x] New or existing tests cover these changes.
- [x] The documentation is up to date with these changes.
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.
Contributors can view more details about this message here.
/ok to test 0d7d3c5
😬 CI Workflow Results
🟥 Finished in 3h 06m: Pass: 85%/120 | Total: 4d 06h | Max: 3h 05m | Hits: 24%/220316
See results here.
/ok to test eeb7182
/ok to test ed7d4fd
/ok to test feb88e5
😬 CI Workflow Results
🟥 Finished in 1h 02m: Pass: 97%/120 | Total: 18h 35m | Max: 49m 26s | Hits: 98%/229382
See results here.
/ok to test ab34e42
🥳 CI Workflow Results
🟩 Finished in 56m 32s: Pass: 100%/42 | Total: 9h 10m | Max: 40m 27s | Hits: 81%/20478
See results here.
Question: If only Domain A and NOT Domain B specializes an algorithm, is the result an error?
Yes
Yes
I am not sure whether that is a correct approach. I dont know enough about domains, but I could imagine that specializing algorithms for a specific domain is a valid use case.
With the proposed design, how would I as Domain A author specialize algorithms, if I have no access / knowledge about Domain B? In the end It is the user connecting those domains?