AUTOSAR C++14 Rule A13-2-1
An assignment operator shall return a reference to "this"
描述
规则定义
An assignment operator shall return a reference to "this".
Polyspace 实现
以下运算符针对类方法应返回 *this,针对普通函数应返回 *first_arg:
operator=operator+=operator-=operator*=operator >>=operator <<=operator /=operator %=operator |=operator &=operator ^=前缀
operator++前缀
operator--
当没有返回相应的值时,不会报告违规。
如果类型不匹配,不会显示特殊消息。
报告文件中的消息:
An assignment operator shall return a reference to
*this.An assignment operator shall return a reference to its first arg.
故障排除
如果您预期会出现违规,而 Polyspace® 未报告该违规,请参阅诊断为何编码规范违规未按预期显示。
检查信息
| 组:重载 |
| 类别:必需、自动 |
版本历史记录
在 R2019a 中推出