☰
  • 首页
  • 规则分类
  • 项目介绍
search
•••

移动构造函数的参数应为同类对象的非 const 右值引用

6.8.6 ID_illMoveConstructorParam
目录 › next › previous

移动构造意在将参数的数据转移到当前对象中,故参数应为右值引用,且不应受 const 关键字限制。

示例:

struct A {
    A(const A&&);   // Non-compliant
    ....
};

相关

ID_nonStdMoveAssignmentParam
Copyright©2024 360 Security Technology Inc., Licensed under the Apache-2.0 license.