cplusplus / sender-receiver

Issues list for P2300
Apache License 2.0
20 stars 3 forks source link

Investigate feasibility of replacing `tag_invoke` with ranges-like CPOs #49

Closed ericniebler closed 3 months ago

ericniebler commented 10 months ago

Issue by ericniebler Friday Nov 18, 2022 at 20:36 GMT Originally opened as https://github.com/NVIDIA/stdexec/issues/686


Rather than having Mine::my_cpo(args) find its customizations by making an ADL call to tag_invoke(Mine::my_cpo, args), look into having the customization be found with my_cpo(Mine::my_cpo, args). This would avoid the scaling issues of tag_invoke.

The tricky part is making sure that arbitrary queries can be forwarded in this scheme. This can be done if queries provide a CRTP base that does the forwarding for you.

The following gist demonstrates the technique: https://gist.github.com/ericniebler/8e07f57a50d4de989d26bf15159a4730

In light of the fact that we're unlikely to get language support for customization points in C++26, it's important (IMO) to find a scalable replacement for tag_invoke.

inbal2l commented 3 months ago

@lewissbaker - can this be closed as we have P2855R1?

lewissbaker commented 3 months ago

Yes, all mention of tag_invoke has now been excised from P2300R10 wording. Closing.