0
Why we choose lambda functions while there is a better way?
I can't get the usage of lambda functions.
2 Answers
0
lambda functions are jst for a particular purpose, instead of writing a function of 3 lines, lambdas shorten it to just a line, if u want to test or check something in a program, use lambdas
0
lambdas are often used if you want to declare a function on the fly, for example a small callback for something asyncrounous or a function that you can apply to a vector using std::transform and similar functions or more general when you need to pass a small function to a function