Boost logo

Boost-Commit :

From: anthony_at_[hidden]
Date: 2008-06-09 10:00:03


Author: anthonyw
Date: 2008-06-09 10:00:03 EDT (Mon, 09 Jun 2008)
New Revision: 46273
URL: http://svn.boost.org/trac/boost/changeset/46273

Log:
Disable general templated thread constructor for movable types, in order to prevent it trying to act as a thread copy constructor for EDG based compilers
Text files modified:
   trunk/boost/thread/detail/thread.hpp | 7 +++++--
   1 files changed, 5 insertions(+), 2 deletions(-)

Modified: trunk/boost/thread/detail/thread.hpp
==============================================================================
--- trunk/boost/thread/detail/thread.hpp (original)
+++ trunk/boost/thread/detail/thread.hpp 2008-06-09 10:00:03 EDT (Mon, 09 Jun 2008)
@@ -20,6 +20,7 @@
 #include <boost/bind.hpp>
 #include <stdlib.h>
 #include <memory>
+#include <boost/utility/enable_if.hpp>
 
 #include <boost/config/abi_prefix.hpp>
 
@@ -134,6 +135,8 @@
         {
             return detail::thread_data_ptr(detail::heap_new<detail::thread_data<F> >(f));
         }
+
+ struct dummy;
 #endif
     public:
         thread();
@@ -166,12 +169,12 @@
         
 #else
         template <class F>
- explicit thread(F f):
+ explicit thread(F f,typename disable_if<boost::is_convertible<F&,detail::thread_move_t<F> >, dummy* >::type=0):
             thread_info(make_thread_info(f))
         {
             start_thread();
         }
-
+
         template <class F>
         thread(detail::thread_move_t<F> f):
             thread_info(make_thread_info(f))


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