main:()={// future from a packaged_tasktask:std::packaged_task<int()>=:()->int=7;// wrap the functionf1:std::future<int>=task.get_future();// get a futuret1:std::thread=(movetask);// launch on a thread// future from an async()f2:std::future<int>=std::async(std::launch::async,:()->int=8);// future from a promisep:std::promise<int>=();f3:std::future<int>=p.get_future();std::thread(:()=p&$*.set_value_at_thread_exit(9)).detach();std::cout<<"Waiting..."<<std::flush;f1.wait();f2.wait();f3.wait();std::cout<<"Done!\nResults are: (f1.get())$ (f2.get())$ (f3.get())$\n";t1.join();}