不受歡迎人物(拉丁語:Persona non grata;複數:personae non gratae,亦簡寫作PNG)是一個政治、外交上的名詞,指被一國外交或警察部门明确公开宣告的特定一类人,这些人被明确列入拒絕入境名单,或被要求限期离境,且均为外交相关人士。這項決定一般而言不須作出公開解釋,儘管其背後原因在一些時候很明顯,例如:逃犯、間諜行為、政治因素。
10
1
I have a function that searches a vector of iterators and returns the iterator if its names matches a string passed as an argument. koalaGraph::PVertex lookUpByName(std::string Name, std::vector<koalaGraph::PVertex>& Vertices) { for (size_t i = 0; i < Vertices.size(); i++) { if(Vertices[i]->info.name == Name) return Vertices[i]; } } My question is how can I implement this as a lambda, to use it in connection with std::find_if ? I'm trying this: std::vector<koalaGraph::PVertex> V; std::string Name; std::find_if(V.begin(), V.end(), [&Name]() {return Name == V->info.name;}) But it says that V an enclosing-function local variable cannot be referenced in a lambda body unless it is in the capture list.
...