C++ 线程和线程指针 简单示意
1 #include <iostream> 2 #include <thread> 3 4 void Func() 5 { 6 std::cout << "hello" << std::endl; 7 } 8 9 int main() 10 { 11 //ok 12 //std::thread tmp(Func); 13 //tmp.join(); 14 15 //ok 16 std::thread *tmp = new std::thread(Func); 17 tmp->join(); 18 delete tmp; 19 }