NVIDIA / stdexec

`std::execution`, the proposed C++ framework for asynchronous and parallel programming.
Apache License 2.0
1.56k stars 159 forks source link

replace all remaining uses of `__x` with `__id` #944

Closed ericniebler closed 9 months ago

ericniebler commented 1 year ago

See discussion here for background

sarthaknimbalkar commented 1 year ago

Hey @ericniebler Can you please say what i exactly need to do here, I'm ready to give it a try.

ericniebler commented 1 year ago

Sure. There are places that use __x to hide a template parameter's associated namespaces. You'll see this pattern in code:

template <class ReceiverId>
struct xyz_receiver {
  using Receiver = stdexec::__t<ReceiverId>;
  // ... receiver implementation here
};

// ... later

template <class Receiver>
xyz_receiver< stdexec::__x<Receiver> > make_xyz_receiver(Receiver rcvr) {...

With __id, the code needs to become:

template <class ReceiverId>
struct xyz_receiver {
  using Receiver = stdexec::__t<ReceiverId>;

  struct __t {
    using __id = xyz_receiver;
    // receiver implementation here...
  };
};

// ... later

template <class Receiver>
stdexec::__t< xyz_receiver< stdexec::__id<Receiver> > > make_xyz_receiver(Receiver rcvr) {...

Replacing __x with __id this way improves the quality of diagnostics by making nested sender types shorter and less noisy, and so easier to read.

Thanks for offering to help!

sarthaknimbalkar commented 1 year ago

Woahh, that's neat !!! Can you provide me with a head start? I simply want to know which files require modifications, then I'll get going. Thank you.

ericniebler commented 1 year ago

You could start with include/exec/async_scope.hpp.

sarthaknimbalkar commented 1 year ago

Okay It'll do. Thanks