title: c++ future.get() is not blocking
body: <p>According to what's written about <strong>future</strong> in "the c++ programming language 4th edition" <br/>
  §5.3.5.1 page 120: <br/></p>
  
  <blockquote>
    <p>If the value isn’t there yet, our thread is blocked until it arrives.</p>
  </blockquote>
  
  <p>Meaning that <strong>get()</strong> is a blocking method.</p>
  
  <p>Later in §5.3.5.2 page 122 <strong>packaged_task</strong> is explained, and the following code sample is given:</p>
  
  <pre><code>double accum(double* beg, double* end, double init)
  // compute the sum of [beg:end) starting with the initial value init
  {
      return accumulate(beg,end,init);
  }
  
  double comp2(vector&lt;double&gt;&amp; v)
  {
      using Task_type = double(double*,double*,double); // type of task
      packaged_task&lt;Task_type&gt; pt0 {accum}; // package the task (i.e., accum)
      packaged_task&lt;Task_type&gt; pt1 {accum};
      future&lt;double&gt; f0 {pt0.get_future()}; // get hold of pt0’s future
      future&lt;double&gt; f1 {pt1.get_future()}; // get hold of pt1’s future
      double* first = &amp;v[0];
      thread t1 {move(pt0),first,first+v.size()/2,0}; // start a thread for pt0
      thread t2 {move(pt1),first+v.size()/2,first+v.size(),0}; // start a thread for pt1
      // ...
      return f0.get()+f1.get(); // get the results
  } 
  </code></pre>
  
  <p>This makes sense, since according to the quote the following program won't return until the 2 threads in <strong>comp2()</strong> function finished even without calling <strong>join()</strong> on them since the thread that called <strong>comp2()</strong> will wait for the <strong>future</strong>s until they <strong>get()</strong> their value:</p>
  
  <pre><code>int main()
  {
      vector&lt;double&gt; v {1.1, 8.3, 5.6};
      double res = comp2(v);
      return 0;
  }
  </code></pre>
  
  <p>Unfortunately, this doesn't happen like I thought, and I less I call <strong>join()</strong>
  on the 2 threads in <strong>comp2()</strong>, a run-time error will be thrown.</p>
  
  <p>Could someone explain me what am I missing here and why <strong>get()</strong> doesn't block ?</p>