atomgalaxy / review-executor-sendrecv

A board for reviewing the executors proposal P0440
1 stars 0 forks source link

as-receiver #8

Open RobertLeahy opened 4 years ago

RobertLeahy commented 4 years ago

Given that:

It's not clear to me why as-receiver::set_value shouldn't be changed from:

void set_value() noexcept(is_nothrow_invocable_v<F&>) {
  invoke(f_);
}

to

void set_value() noexcept(is_nothrow_invocable_v<F&&>) {
  invoke(move(f_));
}

Given the conversation in #5 one could also make an argument that this function be rvalue ref qualified.

ericniebler commented 4 years ago

The reason is because the way execute in the executor_of concept is specified, the callable should be invoked as an lvalue. I don't know why, that decision precedes my time with the Executors project. I agree it makes sense to change it to an rvalue, but the two places need to be consistent.