【发布时间】:2020-10-08 11:46:12
【问题描述】:
我正在尝试运行这个比较器:
if (std::find(movements->begin(), movements->end(), commandBuffer) != movements->end())
与:
const std::string movements[8] = {"north", "south", "east", "west", "n", "s", "e", "w"};
其中commandBuffer 是std::string。
在 MinGW32 9.2.0 上,我得到以下信息:
错误:'operator==' 不匹配(操作数类型为 'const char' 和 'const std::__cxx11::basic_string')
【问题讨论】:
标签: c++