我有一个矢量word_list,我想在word_list中找到一个单词.我用的是功能
bool Mylayer::existWord(vector<string> word_list, string word)
{
if (std::lower_bound(word_list.begin(), word_list.end(), word) != word_list.end())
{
return true;
}
return false;
}
Run Code Online (Sandbox Code Playgroud)
但它并不确切.有人可以告诉我为什么吗?