Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A8-4-5: Should have an exception for move constructors
#1
Our static analyzer is complaining about our move constructor because we are not moving the entire "oth" input. Instead, we are doing member-wise move, in compliance with A12-8-1:

Code:
class B
{
public:
  B(B&& oth) : ptr(std::move(oth.ptr)) // Compliant
  {
     oth.ptr = nullptr;
  }
};

Do you agree that A8-4-5 should explicitly clarify that the rule does not apply to move constructors?
Reply


Messages In This Thread
A8-4-5: Should have an exception for move constructors - by cgpzs - 05-02-2025, 09:45 AM

Forum Jump:


Users browsing this thread: 6 Guest(s)