diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
commit | b8cf34c691623e4ec329053cbbf68522a855882d (patch) | |
tree | 34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/type_traits/detail/has_binary_operator.hpp | |
parent | 3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff) | |
download | boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2 boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip |
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/type_traits/detail/has_binary_operator.hpp')
-rw-r--r-- | boost/type_traits/detail/has_binary_operator.hpp | 85 |
1 files changed, 71 insertions, 14 deletions
diff --git a/boost/type_traits/detail/has_binary_operator.hpp b/boost/type_traits/detail/has_binary_operator.hpp index 039a6bb778..ec6e52e73b 100644 --- a/boost/type_traits/detail/has_binary_operator.hpp +++ b/boost/type_traits/detail/has_binary_operator.hpp @@ -7,19 +7,7 @@ // See http://www.boost.org/libs/type_traits for most recent version including documentation. #include <boost/config.hpp> -#include <boost/type_traits/detail/yes_no_type.hpp> -#include <boost/type_traits/integral_constant.hpp> -#include <boost/type_traits/is_base_of.hpp> -#include <boost/type_traits/is_const.hpp> -#include <boost/type_traits/is_convertible.hpp> -#include <boost/type_traits/is_fundamental.hpp> -#include <boost/type_traits/is_integral.hpp> -#include <boost/type_traits/is_pointer.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/type_traits/is_void.hpp> -#include <boost/type_traits/remove_cv.hpp> -#include <boost/type_traits/remove_pointer.hpp> -#include <boost/type_traits/remove_reference.hpp> +#include <boost/type_traits/detail/config.hpp> // cannot include this header without getting warnings of the kind: // gcc: @@ -37,12 +25,78 @@ # pragma GCC system_header #elif defined(BOOST_MSVC) # pragma warning ( push ) -# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913) +# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913 4133) # if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) # pragma warning ( disable : 6334) # endif #endif +#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 U, class Ret, class = boost::void_t<>> + struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp) : public boost::false_type {}; + + template <class T, class U, class Ret> + struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp)<T, U, Ret, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP std::declval<typename add_reference<U>::type>())> > + : public boost::integral_constant<bool, ::boost::is_convertible<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP std::declval<typename add_reference<U>::type>()), Ret>::value> {}; + + template <class T, class U, class = boost::void_t<> > + struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp) : public boost::false_type {}; + + template <class T, class U> + struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp)<T, U, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP std::declval<typename add_reference<U>::type>())> > + : public boost::integral_constant<bool, ::boost::is_void<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP std::declval<typename add_reference<U>::type>())>::value> {}; + + template <class T, class U, class = boost::void_t<>> + struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp) : public boost::false_type {}; + + template <class T, class U> + struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp)<T, U, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP std::declval<typename add_reference<U>::type>())> > + : public boost::true_type {}; + + } + + template <class T, class U = 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, U, Ret> {}; + template <class T, class U> + struct BOOST_TT_TRAIT_NAME<T, U, void> : public boost::binary_op_detail:: BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp) <T, U> {}; + template <class T, class U> + struct BOOST_TT_TRAIT_NAME<T, U, boost::binary_op_detail::dont_care> : public boost::binary_op_detail:: BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp) <T, U> {}; + + +} + +#else + +#include <boost/type_traits/detail/yes_no_type.hpp> +#include <boost/type_traits/integral_constant.hpp> +#include <boost/type_traits/is_base_of.hpp> +#include <boost/type_traits/is_const.hpp> +#include <boost/type_traits/is_convertible.hpp> +#include <boost/type_traits/is_fundamental.hpp> +#include <boost/type_traits/is_integral.hpp> +#include <boost/type_traits/is_pointer.hpp> +#include <boost/type_traits/is_same.hpp> +#include <boost/type_traits/is_void.hpp> +#include <boost/type_traits/remove_cv.hpp> +#include <boost/type_traits/remove_pointer.hpp> +#include <boost/type_traits/remove_reference.hpp> +#include <boost/type_traits/detail/is_likely_lambda.hpp> + namespace boost { namespace detail { @@ -217,6 +271,9 @@ struct BOOST_TT_TRAIT_NAME : public integral_constant<bool, (::boost::detail::BO } // namespace boost +#endif + #if defined(BOOST_MSVC) # pragma warning ( pop ) #endif + |