isocpp / isocpp/CppCoreGuidelines

Split off 2 new rules from rule F.18

Open
#1,728 0 comments 0 reactions 1 assignee View on GitHub

@hsutter is already working on this.

Since Feb 18, 2021.

Dominant language
CSS
Stars
45.3k
Forks
5.6k
PR merge metrics
No merged PRs in 30d

Description

Rule F.18 is about "For “will-move-from” parameters, pass by X&& and std::move the parameter". There are 3 enforcements defined for this rule:

  1. Flag all X&& parameters (where X is not a template type parameter name) where the function body uses them without std::move.
  2. Flag access to moved-from objects.
  3. Don’t conditionally move from objects

The first one is indeed about this rule, but the second and third one are not about this rule. They should have been rules on their own with an own explanation. I am writing a code checker for the Core Guidelines and I know for sure that we will get questions why for instance accessing a move-from object later on in the same function (enforcement 2) has anything to do with "will-move-from" parameters.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.