]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/thread/detail/nullary_function.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / thread / detail / nullary_function.hpp
index b3989cf682e28ffb77cf051d4907ac9bfbec7196..2950942f11cd31c857e62a43269cadaaf0204427 100644 (file)
@@ -3,7 +3,7 @@
 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //
-// 2013/09 Vicente J. Botet Escriba
+// 2013,2018 Vicente J. Botet Escriba
 //    Adapt to boost from CCIA C++11 implementation
 //    Make use of Boost.Move
 
@@ -15,6 +15,7 @@
 #include <boost/thread/detail/move.hpp>
 #include <boost/thread/csbl/memory/shared_ptr.hpp>
 #include <boost/type_traits/decay.hpp>
+#include <boost/type_traits/is_same.hpp>
 
 namespace boost
 {
@@ -72,12 +73,16 @@ namespace boost
 
 #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
       template<typename F>
-      explicit nullary_function(F& f):
+      explicit nullary_function(F& f
+                                , typename disable_if<is_same<typename decay<F>::type, nullary_function>, int* >::type=0
+                                ):
       impl(new impl_type<F>(f))
       {}
 #endif
       template<typename F>
-      nullary_function(BOOST_THREAD_RV_REF(F) f):
+      nullary_function(BOOST_THREAD_RV_REF(F) f
+                       , typename disable_if<is_same<typename decay<F>::type, nullary_function>, int* >::type=0
+                       ):
       impl(new impl_type<typename decay<F>::type>(thread_detail::decay_copy(boost::forward<F>(f))))
       {}