小编Bru*_* Su的帖子

为什么添加"const"解决"无效的操作数到二进制表达式"

我已经超载了运营商+ Integer operator+(Integer & a, Integer & b).但是当我执行a = b + c + d时,它会将无效操作数的错误提供给二进制表达式.但是通过添加const参数,不会再出现错误.为什么会这样?

c++ overloading constants

1
推荐指数
1
解决办法
718
查看次数

标签 统计

c++ ×1

constants ×1

overloading ×1