title: C++ std::Thread program does nothing
body: <p>I'm playing around with the std::Thread class and wrote this small code to test it but it seams that it does nothing actually.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;thread&gt;
  
  using namespace std;
  
  class TestThread
  {
    public:
        TestThread();
        ~TestThread();
        void foo();
        void bar();
  };
  
  TestThread::TestThread()
  {}
  
  TestThread::~TestThread()
  {}
  
  void TestThread::foo()
  {
    while(true)
      cout &lt;&lt; "Thread 1 reporting" &lt;&lt; endl;
  }
  
  void TestThread::bar()
  {
    while(true)
      cout &lt;&lt; "Thread 2 reporting" &lt;&lt; endl;
  }
  
  
  int main(int argc, char**argv)
  {
     TestThread test;
     thread t1(&amp;TestThread::foo, &amp;test);
     thread t2(&amp;TestThread::bar, &amp;test);
     t1.join();
     t2.join();
     return 0;
  } 
  </code></pre>
  
  <p>When I execute this, it basically does nothing. It stops after I start it without printing anything. Am I doing something wrong?</p>