diff --git a/example/executor.cpp b/example/executor.cpp index cd550dce..cb8fccc9 100644 --- a/example/executor.cpp +++ b/example/executor.cpp @@ -8,7 +8,7 @@ #define BOOST_RESULT_OF_USE_DECLTYPE #endif #ifndef BOOST_NO_CXX11_DECLTYPE_N3276 -#define BOOST_THREAD_NO_CXX11_DECLTYPE_N3276 +//#define BOOST_THREAD_NO_CXX11_DECLTYPE_N3276 #endif #define BOOST_THREAD_VERSION 4 diff --git a/example/future_fallback_to.cpp b/example/future_fallback_to.cpp index e3944e47..c148b7c1 100644 --- a/example/future_fallback_to.cpp +++ b/example/future_fallback_to.cpp @@ -5,7 +5,7 @@ #include #ifndef BOOST_NO_CXX11_DECLTYPE_N3276 -#define BOOST_THREAD_NO_CXX11_DECLTYPE_N3276 +//#define BOOST_THREAD_NO_CXX11_DECLTYPE_N3276 #endif #if ! defined BOOST_NO_CXX11_DECLTYPE #define BOOST_RESULT_OF_USE_DECLTYPE diff --git a/example/future_then.cpp b/example/future_then.cpp index 5402bce3..1e3cc9c3 100644 --- a/example/future_then.cpp +++ b/example/future_then.cpp @@ -5,7 +5,7 @@ #include #ifndef BOOST_NO_CXX11_DECLTYPE_N3276 -#define BOOST_THREAD_NO_CXX11_DECLTYPE_N3276 +//#define BOOST_THREAD_NO_CXX11_DECLTYPE_N3276 #endif #if ! defined BOOST_NO_CXX11_DECLTYPE #define BOOST_RESULT_OF_USE_DECLTYPE diff --git a/example/future_unwrap.cpp b/example/future_unwrap.cpp index 081f1088..f49b98d5 100644 --- a/example/future_unwrap.cpp +++ b/example/future_unwrap.cpp @@ -5,7 +5,7 @@ #include #ifndef BOOST_NO_CXX11_DECLTYPE_N3276 -#define BOOST_THREAD_NO_CXX11_DECLTYPE_N3276 +//#define BOOST_THREAD_NO_CXX11_DECLTYPE_N3276 #endif #if ! defined BOOST_NO_CXX11_DECLTYPE #define BOOST_RESULT_OF_USE_DECLTYPE diff --git a/example/generic_executor_ref.cpp b/example/generic_executor_ref.cpp index 4d2aa7f1..15b3b948 100644 --- a/example/generic_executor_ref.cpp +++ b/example/generic_executor_ref.cpp @@ -8,7 +8,7 @@ #define BOOST_RESULT_OF_USE_DECLTYPE #endif #ifndef BOOST_NO_CXX11_DECLTYPE_N3276 -#define BOOST_THREAD_NO_CXX11_DECLTYPE_N3276 +//#define BOOST_THREAD_NO_CXX11_DECLTYPE_N3276 #endif #define BOOST_THREAD_VERSION 4 diff --git a/example/lambda_future.cpp b/example/lambda_future.cpp index b58d37af..2f77bca4 100644 --- a/example/lambda_future.cpp +++ b/example/lambda_future.cpp @@ -9,7 +9,7 @@ #define BOOST_RESULT_OF_USE_DECLTYPE #endif #ifndef BOOST_NO_CXX11_DECLTYPE_N3276 -#define BOOST_THREAD_NO_CXX11_DECLTYPE_N3276 +//#define BOOST_THREAD_NO_CXX11_DECLTYPE_N3276 #endif #define BOOST_THREAD_VERSION 4 diff --git a/include/boost/thread/future.hpp b/include/boost/thread/future.hpp index c3867d9d..54708dba 100644 --- a/include/boost/thread/future.hpp +++ b/include/boost/thread/future.hpp @@ -827,11 +827,6 @@ namespace boost { this->set_async(); } - explicit future_async_shared_state_base(BOOST_THREAD_RV_REF(boost::thread) th) : - thr_(boost::move(th)) - { - this->set_async(); - } ~future_async_shared_state_base() { @@ -851,12 +846,9 @@ namespace boost template struct future_async_shared_state: future_async_shared_state_base { - typedef future_async_shared_state_base base_type; - - public: - explicit future_async_shared_state(BOOST_THREAD_FWD_REF(Fp) f) : - base_type(thread(&future_async_shared_state::run, this, boost::move(f))) + explicit future_async_shared_state(BOOST_THREAD_FWD_REF(Fp) f) { + this->thr_ = thread(&future_async_shared_state::run, this, boost::forward(f)); } static void run(future_async_shared_state* that, BOOST_THREAD_FWD_REF(Fp) f) @@ -881,12 +873,9 @@ namespace boost template struct future_async_shared_state: public future_async_shared_state_base { - typedef future_async_shared_state_base base_type; - - public: - explicit future_async_shared_state(BOOST_THREAD_FWD_REF(Fp) f) : - base_type(thread(&future_async_shared_state::run, this, boost::move(f))) + explicit future_async_shared_state(BOOST_THREAD_FWD_REF(Fp) f) { + this->thr_ = thread(&future_async_shared_state::run, this, boost::move(f)); } static void run(future_async_shared_state* that, BOOST_THREAD_FWD_REF(Fp) f) @@ -912,12 +901,12 @@ namespace boost template struct future_async_shared_state: future_async_shared_state_base { - typedef future_async_shared_state_base base_type; + //typedef future_async_shared_state_base base_type; public: - explicit future_async_shared_state(BOOST_THREAD_FWD_REF(Fp) f) : - base_type(thread(&future_async_shared_state::run, this, boost::move(f))) + explicit future_async_shared_state(BOOST_THREAD_FWD_REF(Fp) f) { + this->thr_ = thread(&future_async_shared_state::run, this, boost::move(f)); } static void run(future_async_shared_state* that, BOOST_THREAD_FWD_REF(Fp) f)