Back to slide -- Keyboard shortcut: 'u'  previous -- Keyboard shortcut: 'p'  next -- Keyboard shortcut: 'n'          lambda-expressions/lambda1.cc - An immediate call of a lambda expression.Lecture 3 - slide 2 : 27
Program 3

// Immediate call of a lambda expression on the actual parameter 1, without putting it into a variable.

#include <iostream>     
#include <string>

int main () {
  int m{5}, n{6};

  std::cout << "f1(1): " <<  [=](int x){return x + n + m;}(1) << std::endl;   // f1(1): 12
}