title: How to execute a class member function in a separate thread using C++11 thread class?
body: <p>I'm trying to use the C++11's <code>std::thread</code> class to run a member function of a class to execute in parallel.</p>
  
  <p>The header file's code is similar to:</p>
  
  <pre><code>class SomeClass {
      vector&lt;int&gt; classVector;
      void threadFunction(bool arg1, bool arg2);
  public:
      void otherFunction();
  };
  </code></pre>
  
  <p>The cpp file is similar to:</p>
  
  <pre><code>void SomeClass::threadFunction(bool arg1, bool arg2) {
      //thread task
  }
  
  void SomeClass::otherFunction() {
      thread t1(&amp;SomeClass::threadFunction, arg1, arg2, *this);
      t1.join();
  }
  </code></pre>
  
  <p>I am using Xcode 4.6.1 under Mac OS X 10.8.3. The compiler I am using is Apple LLVM 4.2 which came with the Xcode.</p>
  
  <p>The above code does not work. The compiler error says that <code>"Attempted to use deleted function"</code>.</p>
  
  <p>On the line of thread creation it shows the following massage.</p>
  
  <pre><code>In instantiation of function template specialization 'std::__1::thread::thread&lt;void (SomeClass::*)(bool, bool), bool &amp;, bool &amp;, FETD2DSolver &amp;, void&gt;' requested here
  </code></pre>
  
  <p>I'm new in C++11 and the thread class. Could someone help me?</p>