You need to use something like
readerThreads.push_back(move(th));
This will make th an rvalue, and cause the move ctor to be called. The copy ctor of thread was disabled by design (see Anthony Williams’ C++ Concurrency In Action).
You need to use something like
readerThreads.push_back(move(th));
This will make th an rvalue, and cause the move ctor to be called. The copy ctor of thread was disabled by design (see Anthony Williams’ C++ Concurrency In Action).