#include <iostream>
#include <thread>
int main()
{
auto lambda = [](int a) { std::cout << a << '\n'; };
// Create and execute the thread
std::thread thread(lambda, 10); // Pass 10 to the lambda expression
// The lambda expression will be executed in a separate thread
// Wait for the thread to finish, this is a blocking operation
thread.join();
return 0;
}
ICAgICNpbmNsdWRlIDxpb3N0cmVhbT4KICAgICNpbmNsdWRlIDx0aHJlYWQ+CiAgICAgCiAgICBpbnQgbWFpbigpCiAgICB7CiAgICAgICAgYXV0byBsYW1iZGEgPSBbXShpbnQgYSkgeyBzdGQ6OmNvdXQgPDwgYSA8PCAnXG4nOyB9OwoKICAgICAgICAvLyBDcmVhdGUgYW5kIGV4ZWN1dGUgdGhlIHRocmVhZAogICAgICAgIHN0ZDo6dGhyZWFkIHRocmVhZChsYW1iZGEsIDEwKTsgLy8gUGFzcyAxMCB0byB0aGUgbGFtYmRhIGV4cHJlc3Npb24KICAgICAKICAgICAgICAvLyBUaGUgbGFtYmRhIGV4cHJlc3Npb24gd2lsbCBiZSBleGVjdXRlZCBpbiBhIHNlcGFyYXRlIHRocmVhZAogICAgIAogICAgICAgIC8vIFdhaXQgZm9yIHRoZSB0aHJlYWQgdG8gZmluaXNoLCB0aGlzIGlzIGEgYmxvY2tpbmcgb3BlcmF0aW9uCiAgICAgICAgdGhyZWFkLmpvaW4oKTsKICAgICAKICAgICAgICByZXR1cm4gMDsKICAgIH0=