#include <thread>
#include <iostream>
#include <functional>
using namespace std;
void show(const char *str, const int id)
{
cout << "线程 " << id + 1 << " :" << str << endl;
}
int main()
{
thread t1(show, "hello cplusplus!", 0);
thread t2(show, "你好,C++!", 1);
thread t3(show, "hello!", 2);
return 0;
}
应该是正确的绑定方法,为什么一直报错呢?