title: How to reuse boost::promise object after getting its future value?
body: <pre><code>void sss(boost::promise&lt;std::string&gt;&amp; res)
  {
     res.set_value("hi");
  }
  
  void yyy(boost::promise&lt;std::string&gt;&amp; res)
  {
    res.set_value("hello");
  }
  
  int main()
  {
    boost::thread th;
    boost::promise&lt;std::string&gt; a;
    th = boost::thread(sss, boost::ref(a));
    th.join();
    std::cout &lt;&lt; a.get_future().get() &lt;&lt; std::endl;
    th = boost::thread(yyy, boost::ref(a));
    th.join();
    std::cout &lt;&lt; a.get_future().get() &lt;&lt; std::endl;
  }`
  </code></pre>
  
  <p>I'm getting the error that the promise is already satisfied. How to reuse the same object of promise?</p>