c concurrency in action v2 - Serbipunk/notes GitHub Wiki

thread and unique_ptr

可移动不可复制

传入非赋值复制参数

std::thread t(func, w, std::ref(data));

传入类函数

std::thread t(&X::fuc, &my_x, number)

传入类做参数

std::unique_ptr<object> p(new object);
std::thread t(func, std::move(p));
⚠️ **GitHub.com Fallback** ⚠️