/home/ xwy /ORB SLAM3-master /src/LoopCLosing .cc:985:9:
error: use of an operand of
type 'bool’ in
' operator++’ is forbidden in C++17
985 |
mnFullBAIdx++ ;
/home /xwy/ORB_ SLAM3 -master/src/LoopClosing.cc In member function 'void ORB_ SLAM
3: : LoopCLosing: :MergeLocal()’:
/home / xwy /ORB_ SLAM3 - master/src/LoopClosing.cc:1236:9: error: use of an operand 0
f type ' bool' in
operator++’is forbidden in C++17
1236 |
mnFuLLBAIdx++ ;
error: use of an operand of type ‘bool in‘operator++’ is forbidden in C++17 1236 | mnFulLBAIdx++ ;
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
关注引自免费微信小程序:皆我百晓生
在C++17及以后的版本中,不允许对布尔类型(
bool)使用自增操作符(++)。从错误信息来看,变量mnFullBAIdx可能被误声明为布尔类型。要解决这个问题,你需要确保mnFullBAIdx是可增减的数据类型,比如整数类型int、long、long long等。检查你的代码,在
LoopClosing类或相关的部分,找到mnFullBAIdx的定义,确保它是数值类型的。例如,如果你应该使用整数,可以这样修改:// 假设之前是这样定义的: // bool mnFullBAIdx; // 修改为: int mnFullBAIdx;然后重新编译你的程序。如果还有其他地方使用了这个变量,并且需要保持其作为布尔值的功能,你应该创建一个新的变量来存储计数或索引,并保留原来的变量用于布尔逻辑。
如果你不确定如何修改,提供一下
LoopClosing类相关代码片段,我可以给出更具体的修改建议。本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报 编辑记录