title: Error about std::promise in C++
body: <p>I am trying to pass my class instance into threads and the return the processed objects from threads. I've googled about C++ multithreading, and found that std::promising can be helpful. </p>
  
  <p>However, I am stuck at the very beginning. Here is my code:</p>
  
  <pre><code>void callerFunc()
  {
      //...
      std::promise&lt;DataWareHouse&gt; data_chunks;    
      // DataWareHouse is my customized class
      //data_chunks has a vector&lt;vector&lt;double&gt;&gt; member variable
      std::thread(&amp;run_thread,data_chunks);
      // ............
  }
  
  void run_thread(std::promise&lt;DataWareHouse&gt; data_chunks)
  {
      // ... 
      vector&lt;vector&lt;double&gt;&gt; results;
      // ...
      data_chunks.set_value(results);
  }
  </code></pre>
  
  <p>The above code generates an error:</p>
  
  <pre><code> `error C2248: 'std::promise&lt;_Ty&gt;::promise' : cannot access private member declared in class 'std::promise&lt;_Ty&gt;'`
  </code></pre>
  
  <p>May I know what am I wrong and how to fix it?</p>
  
  <p>Many thanks. :-)</p>