C++: basics of lambda expressions
Example:
auto lambda = [](int x) { return x + 1; };
Lambdas are a concise way to write inline functions.
Solution:
cout << lambda(5); // Outputs: 6
Example: Solution:C++: basics of lambda expressions
Lambdas are a concise way to write inline functions.
auto lambda = [](int x) { return x + 1; };
cout << lambda(5); // Outputs: 6