std::thread([=]{
//my statements and my other stuff, basically here i am updating the database accordingly some conditions.
}).detach();
So, what is the use, benefit or how to use this : std::thread([=]
std::thread([=]{
//my statements and my other stuff, basically here i am updating the database accordingly some conditions.
}).detach();
So, what is the use, benefit or how to use this : std::thread([=]
In this code you are using lambda as std::thread function. [=] is a capture clause and means capture all external variable by value
auto lambdaExample = [](){ std::cout << "HELLO WORLD\n"; };