title: Multiple continuation chaining: boost.future unwrapping. How to do it
body: <p>I am using <code>boost.future&lt;T&gt;</code> with continuations, in boost 1.56.</p>
  
  <p>I have an API that returns a future, that I want to use from inside a
  continuation. So in theory, I need to <code>.unwrap</code> the future before chaining the
  second continuation.</p>
  
  <p>So I do the following:</p>
  
  <pre><code>auto result = api_returns_future().then([](boost::future&lt;R&gt; &amp;&amp; result) {
                      do_something_with_result();
  
                      //Note I could call .get() here, but I don't
                      return api_returns_future();
                }).unwrap() //Now I unwrap the future here
                .then([](boost::future&lt;R&gt; &amp;&amp; result) { ... });
  </code></pre>
  
  <p>Namely, I have:</p>
  
  <ol>
  <li><code>future&lt;R&gt;::then</code></li>
  <li>In the first continuation, I return from the lambda with an API call that returns a <code>boost::future&lt;R&gt;</code> and later I unwrap it.</li>
  <li>After that I want to attach another continuation, but this continuation is never called.</li>
  </ol>
  
  <p>Question:</p>
  
  <ol>
  <li>It would be correct to do this in the first continuation: <code>return api_returns_future().get()</code> (note I call <code>.get()</code> from inside the continuation directly` and give up on unwrapping?. Has this alternative some drawback for the asynchroncity of my code?</li>
  </ol>
  
  <p>EDIT: I updated the question to better reflect what I want to ask after some more research.</p>
  
  <p>Thanks</p>