title: Xcode 7: C++ threads ERROR: Attempting to use a deleted function
body: <p>I have been writing a sudoku solver in c++ on Xcode 7. I managed to write a successful solver using a backtracking algorithm. </p>
  
  <p>Now i'm trying to parallelize whatever functions inside my solver so that I can to speed up the solving algorithm. I have 3 functions that are in charge of checking if the current number trying to be inserted into the grid exists in the row, column or box. (standard sudoku rules). Since these are mutually exclusive operations I want to parallelize them. </p>
  
  <p>I know it's overkill to multithread this program, but the goal is more to learn multithreading rather than speed up my solver algorithm.</p>
  
  <p>This is what I've got so far. 
  I've included the standard c++11 thread library. 
  Using default Xcode 7 build settings.</p>
  
  <p>The error I get says that I'm attempting to use a deleted function which pops up when I hit the "Build and Run" button on Xcode. Xcode's intellisense does not complain bout my code. I don't understand this. Please help.</p>
  
  <pre><code>#include &lt;thread&gt;
  </code></pre>
  
  <p>....</p>
  
  <pre><code>typedef uint8_t byte;
  typedef uint16_t dbyte;
  </code></pre>
  
  <p>....</p>
  
  <pre><code>bool sudokuGame::check(byte num, byte row, byte col)
  {
      setBoxFlag(true);
      setColFlag(true);
      setRowFlag(true);
  
      std::thread t1{&amp;sudokuGame::checkRow, num, row};
      std::thread t2{&amp;sudokuGame::checkColumn,num,col};
      std::thread t3{&amp;sudokuGame::checkBox,num,row,col};
  
      t1.join();
      t2.join();
      t3.join();
  
      return (getBoxFlag() &amp;&amp; getRowFlag() &amp;&amp; getColFlag()); 
  }
  </code></pre>
  
  <p>Somewhere inside "thread" where the "attempting to use a deleted function" ERROR pops up.</p>
  
  <p>...</p>
  
  <pre><code>__thread_execute(tuple&lt;_Fp, _Args...&gt;&amp; __t, __tuple_indices&lt;_Indices...&gt;)
  {
      __invoke(_VSTD::move(_VSTD::get&lt;0&gt;(__t)), _VSTD::move(_VSTD::get&lt;_Indices&gt;(__t))...);
  }
  </code></pre>
  
  <p>...</p>
  
  <p>My build settings looks like this</p>
  
  <p><a href="https://i.stack.imgur.com/CZDW8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CZDW8.png" alt="xcode build settings screen capture"></a></p>