ブースト::スレッドを使用して物事が機能する場所があります(ブースト::asioを使用した例)
std::vector<boost::shared_ptr<boost::thread> > threads;
for (std::size_t i = 0; i < io_services_.size(); ++i)
{
boost::shared_ptr<boost::thread> thread(new boost::thread(
boost::bind(&boost::asio::io_service::run, io_services_[i])));
threads.push_back(thread);
}
std:thread で使用しようとすると、コンパイル エラーが発生します。
std::vector<std::thread> threads;
for (std::size_t i = 0; i < this->ioServices.size(); ++i)
{
std::thread thread(&boost::asio::io_service::run, ioServices[i]); // compile error std::thread::thread : no overloaded function takes 2 arguments
threads.push_back(std::move(thread));
}