Skip to content

Add to code style: when to pass reference or move #1129

@fulmicoton

Description

@fulmicoton

add an item about when to pass reference or move, iterator or collection.

TLDR:
If only the reference is used, pass a reference.
More importantly: if the object is used, move. It can sometime help avoid a clone.

Same logic for iterator vs collection

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions