How can I add boost threads to a vector

后端 未结 1 975
予麋鹿
予麋鹿 2021-01-12 03:07

I have something like this that is incorect:

vector vec;
for(int agent = 1; agent <= numAgents; ++agent)
{
    boost::thread agentThr         


        
1条回答
  •  旧时难觅i
    2021-01-12 03:50

    • You must have a compiler with move-semantics supported in order to make your code work,
    • or use vector> with code like:

      vec.push_back(make_shared(sellTickets, agent, numTickets/numAgents));
      
    • or use boost::thread_group.

    0 讨论(0)
提交回复
热议问题