我有一个工作线程,它通过std::thread持续运行、创建和管理。在我的工作线程的顶层,我有一个try/catchblock,里面有一个while循环。如果异常泄漏到线程的顶层,我会捕获它并将其存储在std::exception_ptr中,它是还拥有非静态线程函数的类的成员://Inclassheader(insideclassdeclaration)std::exception_ptrm_threadException;//InclassCPPfilevoidMyClass::MyThreadFunction(){try{while(true){//Dothreadstuff}}c