CppCoreGuidelines icon indicating copy to clipboard operation
CppCoreGuidelines copied to clipboard

Split off 2 new rules from rule F.18

Open pauljansen42 opened this issue 5 years ago • 0 comments

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.

pauljansen42 avatar Dec 30 '20 15:12 pauljansen42