|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83649 - trunk/boost/thread
From: vicente.botet_at_[hidden]
Date: 2013-03-30 10:36:41
Author: viboes
Date: 2013-03-30 10:36:41 EDT (Sat, 30 Mar 2013)
New Revision: 83649
URL: http://svn.boost.org/trac/boost/changeset/83649
Log:
Thread: remove what() function from future_error to take care of #8337.
Text files modified:
trunk/boost/thread/future.hpp | 86 +++++++++++++++++++++++++++++++++++++--
1 files changed, 80 insertions(+), 6 deletions(-)
Modified: trunk/boost/thread/future.hpp
==============================================================================
--- trunk/boost/thread/future.hpp (original)
+++ trunk/boost/thread/future.hpp 2013-03-30 10:36:41 EDT (Sat, 30 Mar 2013)
@@ -101,11 +101,6 @@
{
return ec_;
}
- const char* what() const BOOST_THREAD_NOEXCEPT_OR_THROW
- {
- return code().message().c_str();
- }
-
};
class BOOST_SYMBOL_VISIBLE future_uninitialized:
@@ -262,6 +257,7 @@
}
void set_async()
{
+ is_deferred_ = false;
set_launch_policy(launch::async);
}
void set_launch_policy(launch policy)
@@ -3257,7 +3253,55 @@
#endif
////////////////////////////////
- // make_shared_future
+ // make_ready_future
+ ////////////////////////////////
+ template <typename T>
+ BOOST_THREAD_FUTURE<typename decay<T>::type> make_ready_future(BOOST_THREAD_FWD_REF(T) value)
+ {
+ typedef typename decay<T>::type future_type;
+ promise<future_type> p;
+ p.set_value(boost::forward<T>(value));
+ return BOOST_THREAD_MAKE_RV_REF(p.get_future());
+ }
+
+#if defined BOOST_THREAD_USES_MOVE
+ inline BOOST_THREAD_FUTURE<void> make_ready_future()
+ {
+ promise<void> p;
+ p.set_value();
+ return BOOST_THREAD_MAKE_RV_REF(p.get_future());
+ }
+#endif
+
+ ////////////////////////////////
+ // make_exceptional_future
+ ////////////////////////////////
+ template <typename T>
+ BOOST_THREAD_FUTURE<T> make_exceptional_future(exception_ptr ex)
+ {
+ promise<T> p;
+ p.set_exception(ex);
+ return BOOST_THREAD_MAKE_RV_REF(p.get_future());
+ }
+
+#if 0
+ template<typename CLOSURE>
+ make_future(CLOSURE closure) -> BOOST_THREAD_FUTURE<decltype(closure())> {
+ typedef decltype(closure() T;
+ promise<T> p;
+ try
+ {
+ p.set_value(closure());
+ }
+ catch(...)
+ {
+ p.set_exception(std::current_exception());
+ }
+ return BOOST_THREAD_MAKE_RV_REF(p.get_future());
+ }
+#endif
+ ////////////////////////////////
+ // make_shared_future deprecated
////////////////////////////////
template <typename T>
shared_future<typename decay<T>::type> make_shared_future(BOOST_THREAD_FWD_REF(T) value)
@@ -3277,6 +3321,36 @@
}
////////////////////////////////
+ // make_ready_shared_future
+ ////////////////////////////////
+ template <typename T>
+ shared_future<typename decay<T>::type> make_ready_shared_future(BOOST_THREAD_FWD_REF(T) value)
+ {
+ typedef typename decay<T>::type future_type;
+ promise<future_type> p;
+ p.set_value(boost::forward<T>(value));
+ return p.get_future().share();
+ }
+
+
+ inline shared_future<void> make_ready_shared_future()
+ {
+ promise<void> p;
+ return BOOST_THREAD_MAKE_RV_REF(p.get_future().share());
+
+ }
+
+ ////////////////////////////////
+ // make_exceptional_shared_future
+ ////////////////////////////////
+ template <typename T>
+ shared_future<T> make_exceptional_shared_future(exception_ptr ex)
+ {
+ promise<T> p;
+ p.set_exception(ex);
+ return p.get_future().share();
+ }
+ ////////////////////////////////
// detail::future_continuation
////////////////////////////////
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk