]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/type_traits/detail/has_postfix_operator.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / type_traits / detail / has_postfix_operator.hpp
index ba0358fe402db27b9fa632f76767d9dba37df82c..d900acd3d43a7485b9ea0509fc8d6f68161f4b6d 100644 (file)
@@ -7,6 +7,59 @@
 //  See http://www.boost.org/libs/type_traits for most recent version including documentation.
 
 #include <boost/config.hpp>
+#include <boost/type_traits/detail/config.hpp>
+
+#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION)
+
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/type_traits/make_void.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_void.hpp>
+#include <boost/type_traits/add_reference.hpp>
+#include <utility>
+
+namespace boost
+{
+
+   namespace binary_op_detail {
+
+      struct dont_care;
+
+      template <class T, class Ret, class = void>
+      struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp) : public boost::false_type {};
+
+      template <class T, class Ret>
+      struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp)<T, Ret, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP) >::type>
+         : public boost::integral_constant<bool, ::boost::is_convertible<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP), Ret>::value> {};
+
+      template <class T, class = void >
+      struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp) : public boost::false_type {};
+
+      template <class T>
+      struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp)<T, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>()BOOST_TT_TRAIT_OP)>::type>
+         : public boost::integral_constant<bool, ::boost::is_void<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP)>::value> {};
+
+      template <class T, class = void>
+      struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp) : public boost::false_type {};
+
+      template <class T>
+      struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp)<T, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP)>::type>
+         : public boost::true_type {};
+
+   }
+
+   template <class T, class Ret = boost::binary_op_detail::dont_care>
+   struct BOOST_TT_TRAIT_NAME : public boost::binary_op_detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp) <T, Ret> {};
+   template <class T>
+   struct BOOST_TT_TRAIT_NAME<T, void> : public boost::binary_op_detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp) <T> {};
+   template <class T>
+   struct BOOST_TT_TRAIT_NAME<T, boost::binary_op_detail::dont_care> : public boost::binary_op_detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp) <T> {};
+
+
+}
+
+#else
+
 #include <boost/type_traits/detail/yes_no_type.hpp>
 #include <boost/type_traits/integral_constant.hpp>
 #include <boost/type_traits/is_const.hpp>
@@ -193,3 +246,5 @@ struct BOOST_TT_TRAIT_NAME : public integral_constant<bool, (::boost::detail::BO
 #if defined(BOOST_MSVC)
 #   pragma warning ( pop )
 #endif
+
+#endif