If a function has a non-void return value and I join it using the .join
function then is there any way to retrieve its return value?
Here is a simplified example:
float myfunc(int k)
{
return exp(k);
}
int main()
{
std::thread th=std::thread(myfunc, 10);
th.join();
//Where is the return value?
}