Skip to content

Unnecessary uses of DECAY_COPY #60

Open
@jwakely

Description

@jwakely

The Executor requirements table and [async.system.exec.ops] both say:

Creates an object f1 initialized with DECAY_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 type decay_t<Func>, initialized with forward<Func>(f).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions