📜  c++ start thread later - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:56.094000             🧑  作者: Mango

代码示例1
#include 
#include 

void thread_func(const int i) {
    std::cout << "hello from thread: " << i << std::endl;
}

int main() {
    std::thread t;

    t = std::thread{ thread_func, 7 };
    t.join();
}