Compiling threads under ubuntu

Developer from somewhere

Command to compile: g++ r.cpp -o x -pthread -std=c++0x

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <thread>

using namespace std;
  
void do_work() {
  cout << "Doing work" << endl;
}

int main(int argc,char* argv[]) {
  std::thread t(do_work);
  t.join();
}