Skip to content

quadratic.h: added std::move in constructors#31

Merged
pasabanov merged 1 commit intomainfrom
quadratic_spline
Feb 12, 2025
Merged

quadratic.h: added std::move in constructors#31
pasabanov merged 1 commit intomainfrom
quadratic_spline

Conversation

@pasabanov
Copy link
Copy Markdown
Member

@pasabanov pasabanov commented Feb 12, 2025

Types of changes

  • Refactoring, reformatting, cleanup

Related: #30

Description

Added std::move in constructors in quadratic.h for consistency with other files (step.h, cubic.h).

In addition to moving the Number variables, the SizeT variables were also moved.
The move can be removed for SizeT, since it is trivially copyable by default, but it can be changed by user; also std::move indicated a logical move, even if the value is in fact copied.

Clang-Tidy warns about using std::move on trivially copyable type: https://clang.llvm.org/extra/clang-tidy/checks/performance/move-const-arg.html.
It is recommended to configure this check by turning off the CheckTriviallyCopyableMove option.
In CLion this can be achieved by turning off hicpp-move-const-arg.CheckTriviallyCopyableMove and performance-move-const-arg.CheckTriviallyCopyableMove options.

@pasabanov pasabanov added the refactor Improving code structure without adding new functionality label Feb 12, 2025
@pasabanov pasabanov added this to the First Release Version milestone Feb 12, 2025
@pasabanov pasabanov self-assigned this Feb 12, 2025
@pasabanov pasabanov merged commit b96a259 into main Feb 12, 2025
5 checks passed
@pasabanov pasabanov deleted the quadratic_spline branch February 12, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Improving code structure without adding new functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant