【发布时间】:2019-04-28 05:35:08
【问题描述】:
我正在使用std::find 来检查字符串不在std::vector<std::vector<string>> 中
错误:
no match for 'operator==' (operand types are 'std::vector<std::__cxx11::basic_string<char> >' and 'const char [6]')
不是类型不匹配吗?
vector< vector< string>>data;
if(find(data.begin(), data.end(), "START") == data.end()){
printf("Missing \"START\"\n");
return true;`
【问题讨论】:
-
你有一个向量向量,而不是字符串向量。您的编译器说它无法在向量中找到字符串。
标签: c++ algorithm c++11 stdvector stdstring