fork download
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <thread>
  4. #include <vector>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. vector<thread> v;
  11. v.push_back(thread());
  12. v.push_back(thread());
  13. v.push_back(thread());
  14. for_each(v.begin(), v.end(), [](const thread& t) { cout << t.get_id(); });
  15. }
Success #stdin #stdout 0s 3016KB
stdin
Standard input is empty
stdout
thread::id of a non-executing threadthread::id of a non-executing threadthread::id of a non-executing thread