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

Beginner's Guide to C++