Skip to content

Misleading use of std::move in CompartmentalModel constructor #1381

@julianlitz

Description

@julianlitz

Motivation / Current Behaviour

Description:
The constructor currently takes its arguments by const reference but still applies std::move to them:

CompartmentalModel(Populations const& po, ParameterSet const& pa)
    : populations{std::move(po)}
    , parameters{pa}
{}

Enhancement description

Since po is a const&, std::move(po) produces a const Populations&&, which prevents an actual move. Instead, this forces a copy, making the use of std::move misleading.

Additional context

No response

Checklist

  • Attached labels, especially loc:: or model:: labels.
  • Linked to project

Metadata

Metadata

Assignees

Labels

class::improvementCleanup that doesn't affect functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions