Unnecessary uses of DECAY_COPY
jwakely opened this issue · 1 comments
jwakely commented
The Executor requirements table and [async.system.exec.ops] both say:
Creates an object
f1initialized withDECAY_COPY(forward<Func>(f))
This performs an unnecessary copy, as DECAY_COPY already returns a new object, so this relies on elision to avoid two new objects being created. It also doesn't say what the type of f1 is, so calling f1() could do something entirely unrelated to f.
This seems simpler and more precise:
Creates an object
f1of typedecay_t<Func>, initialized withforward<Func>(f).
jwakely commented
Actually, in the Executor requirements table Func isn't even defined.