我试图了解如何使用std :: find在C++中的指针列表中查找项目
如果我有例如:
std::list<string> words;
std::string word_to_be_found;
Run Code Online (Sandbox Code Playgroud)
我可以像这样搜索:
std::list<string>::iterator matching_iter = std::find(words,begin(), words.end(), word_to_be_found)
Run Code Online (Sandbox Code Playgroud)
但是如果我有一些指针呢?
std::list<string *> words;
Run Code Online (Sandbox Code Playgroud)
以上语法将不再起作用.我能以类似的方式做到吗?
谢谢!