1int main() {
2 // This declares a lambda, which can be called just like a function
3 auto print_message = [](std::string message)
4 {
5 std::cout << message << "\n";
6 };
7
8 // Prints "Hello!" 10 times
9 for(int i = 0; i < 10; i++) {
10 print_message("Hello!");
11 }
12}
13