]> git.lyx.org Git - lyx.git/blobdiff - 3rdparty/boost/boost/variant/detail/apply_visitor_binary.hpp
Update to boost 1.72
[lyx.git] / 3rdparty / boost / boost / variant / detail / apply_visitor_binary.hpp
index e4abf88d720cd7d98390c3c46df1e83ffa12a4a7..7decbdb0e1995c569937f2add5e8232b9dc3f39a 100644 (file)
@@ -4,7 +4,7 @@
 //-----------------------------------------------------------------------------
 //
 // Copyright (c) 2002-2003 Eric Friedman
-// Copyright (c) 2014-2017 Antony Polukhin
+// Copyright (c) 2014-2019 Antony Polukhin
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
 #define BOOST_VARIANT_DETAIL_APPLY_VISITOR_BINARY_HPP
 
 #include <boost/config.hpp>
-#include <boost/detail/workaround.hpp>
-#include <boost/variant/detail/generic_result_type.hpp>
 
 #include <boost/variant/detail/apply_visitor_unary.hpp>
 
-#include <boost/utility/enable_if.hpp>
-
-#if BOOST_WORKAROUND(__EDG__, BOOST_TESTED_AT(302))
-#include <boost/mpl/not.hpp>
-#include <boost/type_traits/is_const.hpp>
-#endif
-
 #if !defined(BOOST_NO_CXX14_DECLTYPE_AUTO) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276)
 #   include <boost/variant/detail/has_result_type.hpp>
 #endif
 
 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+#   include <boost/core/enable_if.hpp>
 #   include <boost/type_traits/is_lvalue_reference.hpp>
 #   include <boost/type_traits/is_same.hpp>
 #   include <boost/move/move.hpp>
@@ -75,14 +67,14 @@ public: // visitor interfaces
 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
 
     template <typename Value2>
-        typename enable_if_c<MoveSemantics && is_same<Value2, Value2>::value, BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)>::type
+        typename enable_if_c<MoveSemantics && is_same<Value2, Value2>::value, result_type>::type
     operator()(Value2&& value2)
     {
         return visitor_(::boost::move(value1_), ::boost::forward<Value2>(value2));
     }
 
     template <typename Value2>
-        typename disable_if_c<MoveSemantics && is_same<Value2, Value2>::value, BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)>::type
+        typename disable_if_c<MoveSemantics && is_same<Value2, Value2>::value, result_type>::type
     operator()(Value2&& value2)
     {
         return visitor_(value1_, ::boost::forward<Value2>(value2));
@@ -91,7 +83,7 @@ public: // visitor interfaces
 #else
 
     template <typename Value2>
-        BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+        result_type
     operator()(Value2& value2)
     {
         return visitor_(value1_, value2);
@@ -129,7 +121,7 @@ public: // visitor interfaces
 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
 
     template <typename Value1>
-        typename enable_if_c<MoveSemantics && is_same<Value1, Value1>::value, BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)>::type
+        typename enable_if_c<MoveSemantics && is_same<Value1, Value1>::value, result_type>::type
     operator()(Value1&& value1)
     {
         apply_visitor_binary_invoke<
@@ -142,7 +134,7 @@ public: // visitor interfaces
     }
 
     template <typename Value1>
-        typename disable_if_c<MoveSemantics && is_same<Value1, Value1>::value, BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)>::type
+        typename disable_if_c<MoveSemantics && is_same<Value1, Value1>::value, result_type>::type
     operator()(Value1&& value1)
     {
         apply_visitor_binary_invoke<
@@ -157,7 +149,7 @@ public: // visitor interfaces
 #else
 
     template <typename Value1>
-        BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+        result_type
     operator()(Value1& value1)
     {
         apply_visitor_binary_invoke<
@@ -182,28 +174,10 @@ private:
 // nonconst-visitor version:
 //
 
-#if !BOOST_WORKAROUND(__EDG__, BOOST_TESTED_AT(302))
-
-#   define BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(V) \
-    BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename V::result_type) \
-    /**/
-
-#else // EDG-based compilers
-
-#   define BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(V) \
-    typename enable_if< \
-          mpl::not_< is_const< V > > \
-        , BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename V::result_type) \
-        >::type \
-    /**/
-
-#endif // EDG-based compilers workaround
-
 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
 
 template <typename Visitor, typename Visitable1, typename Visitable2>
-inline
-    BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(Visitor)
+inline typename Visitor::result_type
 apply_visitor( Visitor& visitor, Visitable1&& visitable1, Visitable2&& visitable2)
 {
     ::boost::detail::variant::apply_visitor_binary_unwrap<
@@ -216,8 +190,7 @@ apply_visitor( Visitor& visitor, Visitable1&& visitable1, Visitable2&& visitable
 #else
 
 template <typename Visitor, typename Visitable1, typename Visitable2>
-inline
-    BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(Visitor)
+inline typename Visitor::result_type
 apply_visitor( Visitor& visitor, Visitable1& visitable1, Visitable2& visitable2)
 {
     ::boost::detail::variant::apply_visitor_binary_unwrap<
@@ -229,8 +202,6 @@ apply_visitor( Visitor& visitor, Visitable1& visitable1, Visitable2& visitable2)
 
 #endif
 
-#undef BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE
-
 //
 // const-visitor version:
 //
@@ -238,10 +209,7 @@ apply_visitor( Visitor& visitor, Visitable1& visitable1, Visitable2& visitable2)
 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
 
 template <typename Visitor, typename Visitable1, typename Visitable2>
-inline
-    BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(
-          typename Visitor::result_type
-        )
+inline typename Visitor::result_type
 apply_visitor( const Visitor& visitor , Visitable1&& visitable1 , Visitable2&& visitable2)
 {
     ::boost::detail::variant::apply_visitor_binary_unwrap<
@@ -254,10 +222,7 @@ apply_visitor( const Visitor& visitor , Visitable1&& visitable1 , Visitable2&& v
 #else
 
 template <typename Visitor, typename Visitable1, typename Visitable2>
-inline
-    BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(
-          typename Visitor::result_type
-        )
+inline typename Visitor::result_type
 apply_visitor( const Visitor& visitor , Visitable1& visitable1 , Visitable2& visitable2)
 {
     ::boost::detail::variant::apply_visitor_binary_unwrap<