About lambda Expressions:
Brush the question when encountered a code does not understand:
char ch = *it;
Auto It2 = find_if (it, B.end (), [CH] (charreturn x! = ch;});
FIND_IF: Returns the value of the iterator when Pred is true, and returns the position of the last element if all elements are not satisfied.
here [Ch] (char x) { return x! = ch;} is to apply a lambda expression.
Lambda expression in lambda expression C + + detailed
Here is the third, capture CH, the parameter is x, if X!=ch returns 1,find_if pred is true, stop iterating, return to it at this time.
"Lambda is an anonymous function that is useful for implementing a very simple function, and we only need to invoke it once ."----know, passer-by.
In addition, pred can also be implemented with the function of imitation, reference here as well as lambda and imitation functions, unknowingly and spread out a good big piece, first save, later used to study again.
About iterators:
For example, for the termination condition of the For loop, it is not possible to use It!=xx.end (), It<=xx.end ().
C + + Learning Note (vii)-lambda expression iterator algorithm