Open
Description
The Executor requirements table and [async.system.exec.ops] both say:
Creates an object
f1
initialized 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
f1
of typedecay_t<Func>
, initialized withforward<Func>(f)
.