title: std::thread class method errors
body: <p>I'm trying to create threads to run row-by-row on a grid-based terrain (i'm not asking if this is efficient, I'm just testing something out) but I keep coming across 2 errors:</p>
  
  <p>first being that if I don't pass the function as </p>
  
  <pre><code>&amp;DJM::Terrain:GenBlocks
  </code></pre>
  
  <p>The compiler tells me to append the &amp; at the start but when I do use the reference it gives me a seperate error connected to xmemory</p>
  
  <pre><code>error C2248: 'std::thread::thread' : cannot access private member declared in class 'std::thread'
  1&gt;          d:\program files\visual studio 2012\vc\include\thread(73) : see declaration of 'std::thread::thread'
  1&gt;          d:\program files\visual studio 2012\vc\include\thread(32) : see declaration of 'std::thread'
  </code></pre>
  
  <p>and I seriously do not understand why. I've read in multiple places that you should put <em>this</em> as the 2nd argument but that gives exactly the same error as above. I have also tried passing <em>i</em> as an std::ref but that gives the same error.</p>
  
  <pre><code>    for(size_t i = 0; i &lt; mHEIGHT; ++i){
              std::thread t(&amp;DJM::Terrain::GenBlocks, &amp;i);
              mThreads.push_back(t);
      }
  
      for(std::vector&lt;std::thread&gt;::iterator iter = mThreads.begin(); iter != mThreads.end(); iter++){
              iter-&gt;join();
      }
  </code></pre>
  
  <p>Quite a large code file so I'd rather not post the entirety of the class but if there's no immediate errors with the code I've posted I'd be happy to post the rest of the code. Note that mThreads is stored as a member variable.</p>