-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
Description
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).