^Betancur-R, R., E. Wiley, N. Bailly, M. Miya, G. Lecointre, and G. Ortí. 2014. Phylogenetic Classification of Bony Fishes --Version 3 (存档副本. [2015-08-09]. (原始内容存档于2015-08-14).).
^Betancur-R., R., R.E. Broughton, E.O. Wiley, K. Carpenter, J.A. Lopez, C. Li, N.I. Holcroft, D. Arcila, M. Sanciangco, J. Cureton, F. Zhang, T. Buser, M. Campbell, T. Rowley, J.A. Ballesteros, G. Lu, T. Grande, G. Arratia & G. Ortí. 2013. The tree of life and a new classification of bony fishes. PLoS Currents Tree of Life. 2013 Apr 18.
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.
...