我有这个错误:
BSPArduino.cpp:316:错误:将“const BSPArduino”传递为“this”
'virtual void BSPArduino::enableWdt(const) 的参数
WATCHDOG_TIMER_DELAY&, const ___bool&)' 丢弃限定符
这个方法的定义如下:
void BSPArduino::enableWdt(const WATCHDOG_TIMER_DELAY &delay, const ___bool &enable)
我想这样称呼它:
enableWdt(this->watchdogTimer, ___false);
With:
WATCHDOG_TIMER_DELAY watchdogTimer;
为什么我会出现此构建错误?
BSPArduino::enableWdt() 是一个非常量方法。如果您尝试从 const 方法调用非常量方法,您将收到此错误。
本质上,该错误试图告诉您,您正在放弃“this”的常量性。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)