std::future
作用:获取线程的结果
使用方法:通常和std::async配合
eg:std::future<int> test = std::async(std::launch::async, [&](){
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
return 8;
});
std:: cout << test.get() << std::endl;
结果为 8.
shared_from_this:
使用一个类的某个成员函数返回指向这个类的指针