c++boostc++11boost-thread

boost::thread_group in C++11?


Is there anything like boost::thread_group in C++11?

I'm just trying to port my program from using boost:thread to C++11 threads and wasn't able to find anything equivalent.


Solution

  • No, there's nothing directly equivalent to boost::thread_group in C++11. You could use a std::vector<std::thread> if all you want is a container. You can then use either the new for syntax or std::for_each to call join() on each element, or whatever.