Boost logo

Boost :

Subject: [boost] future<>::then() Error returning future<void> (on trunk)
From: Fernando Pelliccioni (fpelliccioni_at_[hidden])
Date: 2013-01-22 01:39:45


Hi Vicente, hi all,

I noticed that in the trunk there is a implementation of future<>::then().
Thank you very much for your efforts to implement it!

The following example, compiles OK

    boost::future<int> f1 = boost::async([]() { return 123; });
    f1.then([](boost::future<int> const& f) {
            return std::string("");
    });

But this one fails to compile:
    boost::future<int> f1 = boost::async([]() { return 123; });
    f1.then([](boost::future<int> const& f) {
    });

Here future<>::then() have to returns future<void> like ...

      boost::async([]() { });

Am I right?

On the other hand, have you taken into account the following paper?
    http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3451.pdf

Regards,
Fernando Pelliccioni.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk