1. 线程函数参数未使用引用类型类型
external/libcxx/include/thread:342:5: error: attempt to use a deleted function
__invoke(_VSTD::move(_VSTD::get<1>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
解决办法:使用std::ref将参数转化成引用类型对象
参考:C++ 11 多线程之坑 - 简书 (jianshu.com)
2.线程创建时未传递类对象
external/libcxx/include/type_traits:1678:5: note: '~__nat' has been explicitly marked deleted here
~__nat() = delete;
解决办法:在线程创建过程中第二参数传递函数对象this。
参考:C++11 中thread 多线程的使用_note: '~__nat' has been explicitly marked deleted -CSDN博客