I am trying to pass multiple arguments to the std::thread constructor,however i get the following error:'invoke': no matching overloaded function found
. Here is an extract of the concerned code:
The thread creation:
new std::thread(handle_requests,conn.back(), std::ref(OBook),std::ref(Users_db));
The handle_request
function declaration:
int handle_requests(SOCKET* ClientSocket, OrderBook& OB, DATABASE& db);
I have tried using the std::ref()
wrapper around the Orderbook
and DATABASE
class ,but the error persists.Thanks for your help!