05-02-2025, 09:45 AM
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:
Do you agree that A8-4-5 should explicitly clarify that the rule does not apply to move constructors?
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?