^Espeland, M., Hall, J. P., DeVries, P. J., Lees, D. C., Cornwall, M., Hsu, Y. F., ... & Salzman, S. 2015. Ancient Neotropical origin and recent recolonisation: Phylogeny, biogeography and diversification of the Riodinidae (Lepidoptera: Papilionoidea). Molecular phylogenetics and evolution, 93, 296-306. (英文)
Källersjö, M., G. Bergqvist & A. A. Anderberg. 2000. Generic realignment in primuloid families of the Ericales s. l.: a phylogenetic analysis based on DNA sequences from three chloroplast genes and morphology. Amer. J. Bot. 87: 1325–1341.
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.
...