Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86548 - in trunk: boost/thread libs/thread/test/sync/futures/packaged_task
From: vicente.botet_at_[hidden]
Date: 2013-11-03 11:17:23


Author: viboes
Date: 2013-11-03 11:17:23 EST (Sun, 03 Nov 2013)
New Revision: 86548
URL: http://svn.boost.org/trac/boost/changeset/86548

Log:
Thread: Added missing variadic constructor for task_shared_state.

Text files modified:
   trunk/boost/thread/future.hpp | 28 ++++++++++++++++++++++------
   trunk/libs/thread/test/sync/futures/packaged_task/default_ctor_pass.cpp | 2 +-
   2 files changed, 23 insertions(+), 7 deletions(-)

Modified: trunk/boost/thread/future.hpp
==============================================================================
--- trunk/boost/thread/future.hpp Sun Nov 3 10:49:48 2013 (r86547)
+++ trunk/boost/thread/future.hpp 2013-11-03 11:17:23 EST (Sun, 03 Nov 2013) (r86548)
@@ -30,8 +30,9 @@
 #include <boost/scoped_ptr.hpp>
 #include <boost/type_traits/is_fundamental.hpp>
 #include <boost/thread/detail/is_convertible.hpp>
-#include <boost/type_traits/remove_reference.hpp>
-#include <boost/type_traits/remove_cv.hpp>
+//#include <boost/type_traits/remove_reference.hpp>
+//#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/decay.hpp>
 #include <boost/type_traits/is_void.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/config.hpp>
@@ -2766,11 +2767,17 @@
             private:
               task_shared_state(task_shared_state&);
             public:
+#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
+ R (*f)(BOOST_THREAD_RV_REF(ArgTypes) ... );
+ task_shared_state(R (*f_)(BOOST_THREAD_RV_REF(ArgTypes) ... )):
+ f(f_)
+ {}
+#else
                 R (*f)();
                 task_shared_state(R (*f_)()):
                     f(f_)
                 {}
-
+#endif
 
 #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
                 void do_apply(BOOST_THREAD_RV_REF(ArgTypes) ... args)
@@ -2848,11 +2855,17 @@
             private:
               task_shared_state(task_shared_state&);
             public:
+#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
+ R& (*f)(BOOST_THREAD_RV_REF(ArgTypes) ... );
+ task_shared_state(R& (*f_)(BOOST_THREAD_RV_REF(ArgTypes) ... )):
+ f(f_)
+ {}
+#else
                 R& (*f)();
                 task_shared_state(R& (*f_)()):
                     f(f_)
                 {}
-
+#endif
 
 #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
                 void do_apply(BOOST_THREAD_RV_REF(ArgTypes) ... args)
@@ -3141,7 +3154,8 @@
             , typename boost::disable_if<is_same<typename decay<F>::type, packaged_task>, dummy* >::type=0
             )
         {
- typedef typename remove_cv<typename remove_reference<F>::type>::type FR;
+ //typedef typename remove_cv<typename remove_reference<F>::type>::type FR;
+ typedef typename decay<F>::type FR;
 #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK
   #if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
             typedef detail::task_shared_state<FR,R(ArgTypes...)> task_shared_state_type;
@@ -3222,7 +3236,9 @@
         template <class F, class Allocator>
         packaged_task(boost::allocator_arg_t, Allocator a, BOOST_THREAD_FWD_REF(F) f)
         {
- typedef typename remove_cv<typename remove_reference<F>::type>::type FR;
+ //typedef typename remove_cv<typename remove_reference<F>::type>::type FR;
+ typedef typename decay<F>::type FR;
+
 #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK
   #if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
           typedef detail::task_shared_state<FR,R(ArgTypes...)> task_shared_state_type;

Modified: trunk/libs/thread/test/sync/futures/packaged_task/default_ctor_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/futures/packaged_task/default_ctor_pass.cpp Sun Nov 3 10:49:48 2013 (r86547)
+++ trunk/libs/thread/test/sync/futures/packaged_task/default_ctor_pass.cpp 2013-11-03 11:17:23 EST (Sun, 03 Nov 2013) (r86548)
@@ -27,7 +27,7 @@
 
 #include <boost/thread/future.hpp>
 #include <boost/detail/lightweight_test.hpp>
-
+#include <string>
 
 int main()
 {


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