Skip to content

Evaluate using rvalue references for callback parameters codebase-wide #1570

@coderabbitai

Description

@coderabbitai

Context

During the review of PR #1561, a discussion arose regarding the parameter passing strategy for callbacks in the codebase.

Currently, most of the codebase passes callbacks by value. The PR initially used rvalue references (auto&&) for callback parameters, which offers potential benefits:

  • Increased flexibility: Allows callbacks to be not just lambdas, but also objects that hold stateful values
  • Efficiency: Using rvalue references allows passing objects into the call and using them later without unnecessary copies

Proposal

Evaluate whether it would be beneficial to update the codebase to consistently use rvalue references for callback parameters instead of pass-by-value.

References

Requested by: @LinZhihao-723

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions