What is wrong with the code below? It is supposed to find an element in the list of structs if the first of the struct\'s members equals to 0. The compiler complains about
Code works fine on VS2012, just one recommendation, pass object by reference instead of pass by value:
list<S>::iterator it = find_if(l.begin(), l.end(), [] (const S& s) { return s.S1 == 0; } );