From 6c4e838819a0612ccd8e918f6baf09f489816395 Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Wed, 26 Mar 2014 02:24:01 +0100 Subject: [PATCH] sync --- README.md | 2 ++ include/autobahn.hpp | 1 + test/test7c.cpp | 13 ++++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 02ff2657..dfa257d1 100644 --- a/README.md +++ b/README.md @@ -99,8 +99,10 @@ scons ## Futures +* [C++17: I See a Monad in Your Future! ](http://bartoszmilewski.com/2014/02/26/c17-i-see-a-monad-in-your-future/) * [Boost Thread](http://www.boost.org/doc/libs/1_55_0/doc/html/thread.html) * [Boost Issue: when_all](https://svn.boost.org/trac/boost/ticket/7447) +* [Boost Issue. when_any](https://svn.boost.org/trac/boost/ticket/7446) * [Boost Issue: future fires twice](https://svn.boost.org/trac/boost/ticket/9711) ## Closures Cheetsheet diff --git a/include/autobahn.hpp b/include/autobahn.hpp index 3854a2d5..74651ef8 100644 --- a/include/autobahn.hpp +++ b/include/autobahn.hpp @@ -35,6 +35,7 @@ // http://stackoverflow.com/questions/22597948/using-boostfuture-with-then-continuations/ #define BOOST_THREAD_PROVIDES_FUTURE #define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION +#define BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY #include //#include diff --git a/test/test7c.cpp b/test/test7c.cpp index ff7d69a8..375a470b 100644 --- a/test/test7c.cpp +++ b/test/test7c.cpp @@ -132,6 +132,16 @@ int main () { cerr << "A DONE " << f.get() << endl; }); */ +/* +template + auto adding_func(const Lhs &lhs, const Rhs &rhs) -> decltype(lhs+rhs) {return lhs + rhs;} +*/ + auto xx = 33; + + decltype(xx) yy; + + yy = 2 * xx; + auto f1 = session.call("com.mathservice.add2", {7, 33}); @@ -145,12 +155,13 @@ int main () { cerr << "Result 2: " << any_cast(res.get()) << endl; }); +/* auto f3 = when_all(f1, f2); f3.then([](decltype(f3) res) { cerr << "Done." << endl; }); - +*/ /* wait_for_all(f1, f2); cerr << "Done." << endl;