2021年2月11日星期四

Get the return value of a parameter of async function

I want to get return value of the function wait_for_user_input before if condition!

int wait_for_user_input(){      // get input user      // return input user  }  const auto future = std::async( std::launch::async, wait_for_user_input);  while( future.wait_for( std::chrono::milliseconds(200) ) == std::future_status::timeout ){      // do somthing  }  if ("return of wait_for_user_input"="x"){      // do somthing  }  
https://stackoverflow.com/questions/66159459/get-the-return-value-of-a-parameter-of-async-function February 12, 2021 at 01:12AM

没有评论:

发表评论