I want to call a method (for this example std::thread constructor) with lambda function, passing int value:
int a=10;
std::thread _testThread = thread([a](int _a){
//do stuff using a or _a ?
});
_testThread.detach();
I don't know how to properly write such function, I get this error: C2064: term does not evaluate to a function taking 0 arguments
_a
, as you capturea
. – Garvey_a
? – Garvey