Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12293: boost::future::then lambda called before future is ready.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-08-09 00:06:12
#12293: boost::future::then lambda called before future is ready.
----------------------------------+-------------------------
Reporter: Jeffrey.Gramowski@⦠| Owner: viboes
Type: Bugs | Status: assigned
Milestone: To Be Determined | Component: thread
Version: Boost 1.60.0 | Severity: Problem
Resolution: | Keywords: future then
----------------------------------+-------------------------
Comment (by viboes):
I believe the problem is due to the fact that the continuation returns a
future<void>.
You will need to unwrap the returned future<future<void>>
{{{
}).unwrap().then([&value, &tmpValue](boost::future<void> future){
}}}
However, I would your code to don't compile as the continuation should had
a boost::future<future<void>>.
When I change the continuation as follows I get the expected error.
{{{
}).then([&value, &tmpValue](boost::future<void>& future){
}}}
Note the that the future is passed by reference.
This mean that the call to the continuation is getting the embedded
future. I will check this.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12293#comment:7> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC