编辑器
#include
#include
// Needed for std::function using namespace std; // A function that takes another function as parameter void myFunction(function
func) { func(); func(); } int main() { auto message = []() { cout << "Hello World!\n"; }; myFunction(message); return 0; }
Hello World!
Hello World!