]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/multiprecision/detail/number_compare.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / multiprecision / detail / number_compare.hpp
index 41fcaee54049fc13930e07b228801b6def73aac3..b75d89c0993e83cd60b4f8aff3467dad3fa555a4 100644 (file)
@@ -7,6 +7,7 @@
 #define BOOST_MP_COMPARE_HPP
 
 #include <boost/multiprecision/traits/is_backend.hpp>
+#include <boost/multiprecision/detail/fpclassify.hpp>
 
 //
 // Comparison operators for number.
@@ -27,13 +28,13 @@ inline BOOST_MP_CXX14_CONSTEXPR bool eval_eq(const B& a, const B& b)
    return a.compare(b) == 0;
 }
 template <class T, class U>
-inline BOOST_MP_CXX14_CONSTEXPR bool eval_eq_imp(const T& a, const U& b, const mpl::true_&)
+inline BOOST_MP_CXX14_CONSTEXPR bool eval_eq_imp(const T& a, const U& b, const std::integral_constant<bool, true>&)
 {
    typename boost::multiprecision::detail::number_from_backend<T, U>::type t(b);
    return eval_eq(a, t.backend());
 }
 template <class T, class U>
-inline BOOST_MP_CXX14_CONSTEXPR bool eval_eq_imp(const T& a, const U& b, const mpl::false_&)
+inline BOOST_MP_CXX14_CONSTEXPR bool eval_eq_imp(const T& a, const U& b, const std::integral_constant<bool, false>&)
 {
    typename boost::multiprecision::detail::number_from_backend<U, T>::type t(a);
    return eval_eq(t.backend(), b);
@@ -41,7 +42,7 @@ inline BOOST_MP_CXX14_CONSTEXPR bool eval_eq_imp(const T& a, const U& b, const m
 template <class T, class U>
 inline BOOST_MP_CXX14_CONSTEXPR bool eval_eq(const T& a, const U& b)
 {
-   typedef mpl::bool_<boost::multiprecision::detail::is_first_backend<T, U>::value> tag_type;
+   using tag_type = std::integral_constant<bool, boost::multiprecision::detail::is_first_backend<T, U>::value>;
    return eval_eq_imp(a, b, tag_type());
 }
 
@@ -51,13 +52,13 @@ inline BOOST_MP_CXX14_CONSTEXPR bool eval_lt(const B& a, const B& b)
    return a.compare(b) < 0;
 }
 template <class T, class U>
-inline BOOST_MP_CXX14_CONSTEXPR bool eval_lt_imp(const T& a, const U& b, const mpl::true_&)
+inline BOOST_MP_CXX14_CONSTEXPR bool eval_lt_imp(const T& a, const U& b, const std::integral_constant<bool, true>&)
 {
    typename boost::multiprecision::detail::number_from_backend<T, U>::type t(b);
    return eval_lt(a, t.backend());
 }
 template <class T, class U>
-inline BOOST_MP_CXX14_CONSTEXPR bool eval_lt_imp(const T& a, const U& b, const mpl::false_&)
+inline BOOST_MP_CXX14_CONSTEXPR bool eval_lt_imp(const T& a, const U& b, const std::integral_constant<bool, false>&)
 {
    typename boost::multiprecision::detail::number_from_backend<U, T>::type t(a);
    return eval_lt(t.backend(), b);
@@ -65,7 +66,7 @@ inline BOOST_MP_CXX14_CONSTEXPR bool eval_lt_imp(const T& a, const U& b, const m
 template <class T, class U>
 inline BOOST_MP_CXX14_CONSTEXPR bool eval_lt(const T& a, const U& b)
 {
-   typedef mpl::bool_<boost::multiprecision::detail::is_first_backend<T, U>::value> tag_type;
+   using tag_type = std::integral_constant<bool, boost::multiprecision::detail::is_first_backend<T, U>::value>;
    return eval_lt_imp(a, b, tag_type());
 }
 
@@ -75,13 +76,13 @@ inline BOOST_MP_CXX14_CONSTEXPR bool eval_gt(const B& a, const B& b)
    return a.compare(b) > 0;
 }
 template <class T, class U>
-inline BOOST_MP_CXX14_CONSTEXPR bool eval_gt_imp(const T& a, const U& b, const mpl::true_&)
+inline BOOST_MP_CXX14_CONSTEXPR bool eval_gt_imp(const T& a, const U& b, const std::integral_constant<bool, true>&)
 {
    typename boost::multiprecision::detail::number_from_backend<T, U>::type t(b);
    return eval_gt(a, t.backend());
 }
 template <class T, class U>
-inline BOOST_MP_CXX14_CONSTEXPR bool eval_gt_imp(const T& a, const U& b, const mpl::false_&)
+inline BOOST_MP_CXX14_CONSTEXPR bool eval_gt_imp(const T& a, const U& b, const std::integral_constant<bool, false>&)
 {
    typename boost::multiprecision::detail::number_from_backend<U, T>::type t(a);
    return eval_gt(t.backend(), b);
@@ -89,7 +90,7 @@ inline BOOST_MP_CXX14_CONSTEXPR bool eval_gt_imp(const T& a, const U& b, const m
 template <class T, class U>
 inline BOOST_MP_CXX14_CONSTEXPR bool eval_gt(const T& a, const U& b)
 {
-   typedef mpl::bool_<boost::multiprecision::detail::is_first_backend<T, U>::value> tag_type;
+   using tag_type = std::integral_constant<bool, boost::multiprecision::detail::is_first_backend<T, U>::value>;
    return eval_gt_imp(a, b, tag_type());
 }
 
@@ -98,46 +99,41 @@ inline BOOST_MP_CXX14_CONSTEXPR bool eval_gt(const T& a, const U& b)
 namespace detail {
 
 template <class Num, class Val>
-struct is_valid_mixed_compare : public mpl::false_
+struct is_valid_mixed_compare : public std::integral_constant<bool, false>
 {};
 
 template <class B, expression_template_option ET, class Val>
-struct is_valid_mixed_compare<number<B, ET>, Val> : public is_convertible<Val, number<B, ET> >
+struct is_valid_mixed_compare<number<B, ET>, Val> : public std::is_convertible<Val, number<B, ET> >
 {};
 
 template <class B, expression_template_option ET>
-struct is_valid_mixed_compare<number<B, ET>, number<B, ET> > : public mpl::false_
+struct is_valid_mixed_compare<number<B, ET>, number<B, ET> > : public std::integral_constant<bool, false>
 {};
 
 template <class B, expression_template_option ET, class tag, class Arg1, class Arg2, class Arg3, class Arg4>
 struct is_valid_mixed_compare<number<B, ET>, expression<tag, Arg1, Arg2, Arg3, Arg4> >
-    : public mpl::bool_<is_convertible<expression<tag, Arg1, Arg2, Arg3, Arg4>, number<B, ET> >::value>
+    : public std::is_convertible<expression<tag, Arg1, Arg2, Arg3, Arg4>, number<B, ET> >
 {};
 
 template <class tag, class Arg1, class Arg2, class Arg3, class Arg4, class B, expression_template_option ET>
 struct is_valid_mixed_compare<expression<tag, Arg1, Arg2, Arg3, Arg4>, number<B, ET> >
-    : public mpl::bool_<is_convertible<expression<tag, Arg1, Arg2, Arg3, Arg4>, number<B, ET> >::value>
+    : public std::is_convertible<expression<tag, Arg1, Arg2, Arg3, Arg4>, number<B, ET> >
 {};
 
 template <class Backend, expression_template_option ExpressionTemplates>
-inline BOOST_CONSTEXPR typename boost::enable_if_c<number_category<Backend>::value != number_kind_floating_point, bool>::type is_unordered_value(const number<Backend, ExpressionTemplates>&)
+inline constexpr typename std::enable_if<number_category<Backend>::value != number_kind_floating_point, bool>::type is_unordered_value(const number<Backend, ExpressionTemplates>&)
 {
    return false;
 }
 template <class Backend, expression_template_option ExpressionTemplates>
-inline
-#if !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700)
-    BOOST_CONSTEXPR
-#endif
-    typename boost::enable_if_c<number_category<Backend>::value == number_kind_floating_point, bool>::type
-    is_unordered_value(const number<Backend, ExpressionTemplates>& a)
+inline constexpr typename std::enable_if<number_category<Backend>::value == number_kind_floating_point, bool>::type is_unordered_value(const number<Backend, ExpressionTemplates>& a)
 {
    using default_ops::eval_fpclassify;
    return eval_fpclassify(a.backend()) == FP_NAN;
 }
 
 template <class Arithmetic>
-inline BOOST_CONSTEXPR typename boost::enable_if_c<number_category<Arithmetic>::value != number_kind_floating_point, bool>::type is_unordered_value(const Arithmetic&)
+inline constexpr typename std::enable_if<number_category<Arithmetic>::value != number_kind_floating_point, bool>::type is_unordered_value(const Arithmetic&)
 {
    return false;
 }
@@ -146,7 +142,7 @@ inline
 #ifndef BOOST_MP_NO_CONSTEXPR_DETECTION
     BOOST_MP_CXX14_CONSTEXPR 
 #endif
-   typename boost::enable_if_c < number_category < Arithmetic> ::value == number_kind_floating_point, bool> ::type
+   typename std::enable_if < number_category < Arithmetic> ::value == number_kind_floating_point, bool> ::type
     is_unordered_value(const Arithmetic& a)
 {
 #ifndef BOOST_MP_NO_CONSTEXPR_DETECTION
@@ -157,12 +153,12 @@ inline
    else
 #endif
    {
-      return (boost::math::isnan)(a);
+      return BOOST_MP_ISNAN(a);
    }
 }
 
 template <class T, class U>
-inline BOOST_CONSTEXPR bool is_unordered_comparison(const T& a, const U& b)
+inline constexpr bool is_unordered_comparison(const T& a, const U& b)
 {
    return is_unordered_value(a) || is_unordered_value(b);
 }
@@ -178,7 +174,7 @@ inline BOOST_MP_CXX14_CONSTEXPR bool operator==(const number<Backend, Expression
    return eval_eq(a.backend(), b.backend());
 }
 template <class Backend, expression_template_option ExpressionTemplates, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && !is_number_expression<Arithmetic>::value, bool>::type
 operator==(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
 {
    using default_ops::eval_eq;
@@ -187,7 +183,7 @@ operator==(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
    return eval_eq(a.backend(), number<Backend, ExpressionTemplates>::canonical_value(b));
 }
 template <class Arithmetic, class Backend, expression_template_option ExpressionTemplates>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && !is_number_expression<Arithmetic>::value, bool>::type
 operator==(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
 {
    using default_ops::eval_eq;
@@ -196,29 +192,49 @@ operator==(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
    return eval_eq(b.backend(), number<Backend, ExpressionTemplates>::canonical_value(a));
 }
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
 operator==(const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
 {
-   typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
    using default_ops::eval_eq;
    result_type t(b);
    if (detail::is_unordered_comparison(a, t))
       return false;
    return eval_eq(t.backend(), result_type::canonical_value(a));
 }
+template <class Backend, expression_template_option ExpressionTemplates, class Tag, class A1, class A2, class A3, class A4>
+inline BOOST_MP_CXX14_CONSTEXPR bool operator==(const number<Backend, ExpressionTemplates>& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
+{
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
+   using default_ops::eval_eq;
+   result_type t(b);
+   if (detail::is_unordered_comparison(a, t))
+      return false;
+   return eval_eq(t.backend(), a.backend());
+}
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
 operator==(const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b)
 {
-   typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
    using default_ops::eval_eq;
    result_type t(a);
    if (detail::is_unordered_comparison(t, b))
       return false;
    return eval_eq(t.backend(), result_type::canonical_value(b));
 }
+template <class Tag, class A1, class A2, class A3, class A4, class Backend, expression_template_option ExpressionTemplates>
+inline BOOST_MP_CXX14_CONSTEXPR bool operator==(const detail::expression<Tag, A1, A2, A3, A4>& a, const number<Backend, ExpressionTemplates>& b)
+{
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
+   using default_ops::eval_eq;
+   result_type t(a);
+   if (detail::is_unordered_comparison(t, b))
+      return false;
+   return eval_eq(t.backend(), b.backend());
+}
 template <class Tag, class A1, class A2, class A3, class A4, class Tagb, class A1b, class A2b, class A3b, class A4b>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if<is_same<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<is_equivalent_number_type<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value, bool>::type
 operator==(const detail::expression<Tag, A1, A2, A3, A4>& a, const detail::expression<Tagb, A1b, A2b, A3b, A4b>& b)
 {
    using default_ops::eval_eq;
@@ -238,7 +254,7 @@ inline BOOST_MP_CXX14_CONSTEXPR bool operator!=(const number<Backend, Expression
    return !eval_eq(a.backend(), b.backend());
 }
 template <class Backend, expression_template_option ExpressionTemplates, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && !is_number_expression<Arithmetic>::value, bool>::type
 operator!=(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
 {
    using default_ops::eval_eq;
@@ -247,7 +263,7 @@ operator!=(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
    return !eval_eq(a.backend(), number<Backend, et_on>::canonical_value(b));
 }
 template <class Arithmetic, class Backend, expression_template_option ExpressionTemplates>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && !is_number_expression<Arithmetic>::value, bool>::type
 operator!=(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
 {
    using default_ops::eval_eq;
@@ -256,21 +272,41 @@ operator!=(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
    return !eval_eq(b.backend(), number<Backend, et_on>::canonical_value(a));
 }
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
 operator!=(const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
 {
-   typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
    using default_ops::eval_eq;
    result_type t(b);
    if (detail::is_unordered_comparison(a, t))
       return true;
    return !eval_eq(t.backend(), result_type::canonical_value(a));
 }
+template <class Backend, expression_template_option ExpressionTemplates, class Tag, class A1, class A2, class A3, class A4>
+inline BOOST_MP_CXX14_CONSTEXPR bool operator!=(const number<Backend, ExpressionTemplates>& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
+{
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
+   using default_ops::eval_eq;
+   result_type t(b);
+   if (detail::is_unordered_comparison(a, t))
+      return true;
+   return !eval_eq(t.backend(), a.backend());
+}
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
 operator!=(const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b)
 {
-   typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
+   using default_ops::eval_eq;
+   result_type t(a);
+   if (detail::is_unordered_comparison(t, b))
+      return true;
+   return !eval_eq(t.backend(), result_type::canonical_value(b));
+}
+template <class Tag, class A1, class A2, class A3, class A4, class Backend, expression_template_option ExpressionTemplates>
+inline BOOST_MP_CXX14_CONSTEXPR bool operator!=(const detail::expression<Tag, A1, A2, A3, A4>& a, const number<Backend, ExpressionTemplates>& b)
+{
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
    using default_ops::eval_eq;
    result_type t(a);
    if (detail::is_unordered_comparison(t, b))
@@ -278,7 +314,7 @@ operator!=(const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b
    return !eval_eq(t.backend(), result_type::canonical_value(b));
 }
 template <class Tag, class A1, class A2, class A3, class A4, class Tagb, class A1b, class A2b, class A3b, class A4b>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if<is_same<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<is_equivalent_number_type<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value, bool>::type
 operator!=(const detail::expression<Tag, A1, A2, A3, A4>& a, const detail::expression<Tagb, A1b, A2b, A3b, A4b>& b)
 {
    using default_ops::eval_eq;
@@ -290,7 +326,7 @@ operator!=(const detail::expression<Tag, A1, A2, A3, A4>& a, const detail::expre
 }
 
 template <class Backend, expression_template_option ExpressionTemplates, class Backend2, expression_template_option ExpressionTemplates2>
-inline BOOST_MP_CXX14_CONSTEXPR typename boost::enable_if_c<(number_category<Backend>::value != number_kind_complex) && (number_category<Backend2>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<(number_category<Backend>::value != number_kind_complex) && (number_category<Backend2>::value != number_kind_complex), bool>::type
 operator<(const number<Backend, ExpressionTemplates>& a, const number<Backend2, ExpressionTemplates2>& b)
 {
    using default_ops::eval_lt;
@@ -299,7 +335,7 @@ operator<(const number<Backend, ExpressionTemplates>& a, const number<Backend2,
    return eval_lt(a.backend(), b.backend());
 }
 template <class Backend, expression_template_option ExpressionTemplates, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex) && !is_number_expression<Arithmetic>::value, bool>::type
 operator<(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
 {
    using default_ops::eval_lt;
@@ -308,7 +344,7 @@ operator<(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
    return eval_lt(a.backend(), number<Backend, ExpressionTemplates>::canonical_value(b));
 }
 template <class Arithmetic, class Backend, expression_template_option ExpressionTemplates>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex) && !is_number_expression<Arithmetic>::value, bool>::type
 operator<(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
 {
    using default_ops::eval_gt;
@@ -317,29 +353,45 @@ operator<(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
    return eval_gt(b.backend(), number<Backend, ExpressionTemplates>::canonical_value(a));
 }
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
 operator<(const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
 {
-   typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
    using default_ops::eval_gt;
    result_type t(b);
    if (detail::is_unordered_comparison(a, t))
       return false;
    return eval_gt(t.backend(), result_type::canonical_value(a));
 }
+template <class Backend, expression_template_option ExpressionTemplates, class Tag, class A1, class A2, class A3, class A4>
+inline BOOST_MP_CXX14_CONSTEXPR bool operator<(const number<Backend, ExpressionTemplates>& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
+{
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
+   using default_ops::eval_gt;
+   result_type t(b);
+   return a < t;
+}
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
 operator<(const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b)
 {
-   typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
    using default_ops::eval_lt;
    result_type t(a);
    if (detail::is_unordered_comparison(t, b))
       return false;
    return eval_lt(t.backend(), result_type::canonical_value(b));
 }
+template <class Tag, class A1, class A2, class A3, class A4, class Backend, expression_template_option ExpressionTemplates>
+inline BOOST_MP_CXX14_CONSTEXPR bool operator<(const detail::expression<Tag, A1, A2, A3, A4>& a, const number<Backend, ExpressionTemplates>& b)
+{
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
+   using default_ops::eval_lt;
+   result_type t(a);
+   return t < b;
+}
 template <class Tag, class A1, class A2, class A3, class A4, class Tagb, class A1b, class A2b, class A3b, class A4b>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<is_same<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<is_equivalent_number_type<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
 operator<(const detail::expression<Tag, A1, A2, A3, A4>& a, const detail::expression<Tagb, A1b, A2b, A3b, A4b>& b)
 {
    using default_ops::eval_lt;
@@ -351,7 +403,7 @@ operator<(const detail::expression<Tag, A1, A2, A3, A4>& a, const detail::expres
 }
 
 template <class Backend, expression_template_option ExpressionTemplates, class Backend2, expression_template_option ExpressionTemplates2>
-inline BOOST_MP_CXX14_CONSTEXPR typename boost::enable_if_c<(number_category<Backend>::value != number_kind_complex) && (number_category<Backend2>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<(number_category<Backend>::value != number_kind_complex) && (number_category<Backend2>::value != number_kind_complex), bool>::type
 operator>(const number<Backend, ExpressionTemplates>& a, const number<Backend2, ExpressionTemplates2>& b)
 {
    using default_ops::eval_gt;
@@ -360,7 +412,7 @@ operator>(const number<Backend, ExpressionTemplates>& a, const number<Backend2,
    return eval_gt(a.backend(), b.backend());
 }
 template <class Backend, expression_template_option ExpressionTemplates, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex) && !is_number_expression<Arithmetic>::value, bool>::type
 operator>(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
 {
    using default_ops::eval_gt;
@@ -369,7 +421,7 @@ operator>(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
    return eval_gt(a.backend(), number<Backend, ExpressionTemplates>::canonical_value(b));
 }
 template <class Arithmetic, class Backend, expression_template_option ExpressionTemplates>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex) && !is_number_expression<Arithmetic>::value, bool>::type
 operator>(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
 {
    using default_ops::eval_lt;
@@ -378,41 +430,51 @@ operator>(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
    return eval_lt(b.backend(), number<Backend, ExpressionTemplates>::canonical_value(a));
 }
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
 operator>(const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
 {
-   typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
+   using default_ops::eval_lt;
+   result_type t(b);
+   return a > t;
+}
+template <class Backend, expression_template_option ExpressionTemplates, class Tag, class A1, class A2, class A3, class A4>
+inline BOOST_MP_CXX14_CONSTEXPR bool operator>(const number<Backend, ExpressionTemplates>& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
+{
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
    using default_ops::eval_lt;
    result_type t(b);
-   if (detail::is_unordered_comparison(a, t))
-      return false;
    return a > t;
 }
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
 operator>(const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b)
 {
-   typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
+   using default_ops::eval_gt;
+   result_type t(a);
+   return t > b;
+}
+template <class Tag, class A1, class A2, class A3, class A4, class Backend, expression_template_option ExpressionTemplates>
+inline BOOST_MP_CXX14_CONSTEXPR bool operator>(const detail::expression<Tag, A1, A2, A3, A4>& a, const number<Backend, ExpressionTemplates>& b)
+{
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
    using default_ops::eval_gt;
    result_type t(a);
-   if (detail::is_unordered_comparison(t, b))
-      return false;
    return t > b;
 }
 template <class Tag, class A1, class A2, class A3, class A4, class Tagb, class A1b, class A2b, class A3b, class A4b>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<is_same<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<is_equivalent_number_type<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
 operator>(const detail::expression<Tag, A1, A2, A3, A4>& a, const detail::expression<Tagb, A1b, A2b, A3b, A4b>& b)
 {
    using default_ops::eval_gt;
    typename detail::expression<Tag, A1, A2, A3, A4>::result_type      t(a);
    typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type t2(b);
-   if (detail::is_unordered_comparison(t, t2))
-      return false;
    return t > t2;
 }
 
 template <class Backend, expression_template_option ExpressionTemplates, class Backend2, expression_template_option ExpressionTemplates2>
-inline BOOST_MP_CXX14_CONSTEXPR typename boost::enable_if_c<(number_category<Backend>::value != number_kind_complex) && (number_category<Backend2>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<(number_category<Backend>::value != number_kind_complex) && (number_category<Backend2>::value != number_kind_complex), bool>::type
 operator<=(const number<Backend, ExpressionTemplates>& a, const number<Backend2, ExpressionTemplates2>& b)
 {
    using default_ops::eval_gt;
@@ -421,7 +483,7 @@ operator<=(const number<Backend, ExpressionTemplates>& a, const number<Backend2,
    return !eval_gt(a.backend(), b.backend());
 }
 template <class Backend, expression_template_option ExpressionTemplates, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex) && !is_number_expression<Arithmetic>::value, bool>::type
 operator<=(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
 {
    using default_ops::eval_gt;
@@ -430,7 +492,7 @@ operator<=(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
    return !eval_gt(a.backend(), number<Backend, ExpressionTemplates>::canonical_value(b));
 }
 template <class Arithmetic, class Backend, expression_template_option ExpressionTemplates>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex) && !is_number_expression<Arithmetic>::value, bool>::type
 operator<=(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
 {
    using default_ops::eval_lt;
@@ -439,10 +501,10 @@ operator<=(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
    return !eval_lt(b.backend(), number<Backend, ExpressionTemplates>::canonical_value(a));
 }
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
 operator<=(const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
 {
-   typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
    using default_ops::eval_lt;
    if (detail::is_unordered_value(a) || detail::is_unordered_value(b))
       return false;
@@ -451,19 +513,37 @@ operator<=(const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b
       return false;
    return !eval_lt(t.backend(), result_type::canonical_value(a));
 }
+template <class Backend, expression_template_option ExpressionTemplates, class Tag, class A1, class A2, class A3, class A4>
+inline BOOST_MP_CXX14_CONSTEXPR bool operator<=(const number<Backend, ExpressionTemplates>& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
+{
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
+   using default_ops::eval_lt;
+   if (detail::is_unordered_value(a) || detail::is_unordered_value(b))
+      return false;
+   result_type t(b);
+   return a <= t;
+}
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
 operator<=(const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b)
 {
-   typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
    using default_ops::eval_gt;
    result_type t(a);
    if (detail::is_unordered_comparison(t, b))
       return false;
    return !eval_gt(t.backend(), result_type::canonical_value(b));
 }
+template <class Tag, class A1, class A2, class A3, class A4, class Backend, expression_template_option ExpressionTemplates>
+inline BOOST_MP_CXX14_CONSTEXPR bool operator<=(const detail::expression<Tag, A1, A2, A3, A4>& a, const number<Backend, ExpressionTemplates>& b)
+{
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
+   using default_ops::eval_gt;
+   result_type t(a);
+   return t <= b;
+}
 template <class Tag, class A1, class A2, class A3, class A4, class Tagb, class A1b, class A2b, class A3b, class A4b>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<is_same<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<is_equivalent_number_type<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
 operator<=(const detail::expression<Tag, A1, A2, A3, A4>& a, const detail::expression<Tagb, A1b, A2b, A3b, A4b>& b)
 {
    using default_ops::eval_gt;
@@ -475,7 +555,7 @@ operator<=(const detail::expression<Tag, A1, A2, A3, A4>& a, const detail::expre
 }
 
 template <class Backend, expression_template_option ExpressionTemplates, class Backend2, expression_template_option ExpressionTemplates2>
-inline BOOST_MP_CXX14_CONSTEXPR typename boost::enable_if_c<(number_category<Backend>::value != number_kind_complex) && (number_category<Backend2>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<(number_category<Backend>::value != number_kind_complex) && (number_category<Backend2>::value != number_kind_complex), bool>::type
 operator>=(const number<Backend, ExpressionTemplates>& a, const number<Backend2, ExpressionTemplates2>& b)
 {
    using default_ops::eval_lt;
@@ -484,7 +564,7 @@ operator>=(const number<Backend, ExpressionTemplates>& a, const number<Backend2,
    return !eval_lt(a.backend(), b.backend());
 }
 template <class Backend, expression_template_option ExpressionTemplates, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex) && !is_number_expression<Arithmetic>::value, bool>::type
 operator>=(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
 {
    using default_ops::eval_lt;
@@ -493,7 +573,7 @@ operator>=(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
    return !eval_lt(a.backend(), number<Backend, ExpressionTemplates>::canonical_value(b));
 }
 template <class Arithmetic, class Backend, expression_template_option ExpressionTemplates>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value && (number_category<Backend>::value != number_kind_complex) && !is_number_expression<Arithmetic>::value, bool>::type
 operator>=(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
 {
    using default_ops::eval_gt;
@@ -502,29 +582,45 @@ operator>=(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
    return !eval_gt(b.backend(), number<Backend, ExpressionTemplates>::canonical_value(a));
 }
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
 operator>=(const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
 {
-   typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
    using default_ops::eval_gt;
    result_type t(b);
    if (detail::is_unordered_comparison(a, t))
       return false;
    return !eval_gt(t.backend(), result_type::canonical_value(a));
 }
+template <class Backend, expression_template_option ExpressionTemplates, class Tag, class A1, class A2, class A3, class A4>
+inline BOOST_MP_CXX14_CONSTEXPR bool operator>=(const number<Backend, ExpressionTemplates>& a, const detail::expression<Tag, A1, A2, A3, A4>& b)
+{
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
+   using default_ops::eval_gt;
+   result_type t(b);
+   return a >= t;
+}
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
 operator>=(const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b)
 {
-   typedef typename detail::expression<Tag, A1, A2, A3, A4>::result_type result_type;
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
    using default_ops::eval_lt;
    result_type t(a);
    if (detail::is_unordered_comparison(t, b))
       return false;
    return !eval_lt(t.backend(), result_type::canonical_value(b));
 }
+template <class Tag, class A1, class A2, class A3, class A4, class Backend, expression_template_option ExpressionTemplates>
+inline BOOST_MP_CXX14_CONSTEXPR bool operator>=(const detail::expression<Tag, A1, A2, A3, A4>& a, const number<Backend, ExpressionTemplates>& b)
+{
+   using result_type = typename detail::expression<Tag, A1, A2, A3, A4>::result_type;
+   using default_ops::eval_lt;
+   result_type t(a);
+   return t >= b;
+}
 template <class Tag, class A1, class A2, class A3, class A4, class Tagb, class A1b, class A2b, class A3b, class A4b>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<is_same<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<is_equivalent_number_type<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value && (number_category<typename detail::expression<Tag, A1, A2, A3, A4>::result_type>::value != number_kind_complex), bool>::type
 operator>=(const detail::expression<Tag, A1, A2, A3, A4>& a, const detail::expression<Tagb, A1b, A2b, A3b, A4b>& b)
 {
    using default_ops::eval_lt;
@@ -542,27 +638,27 @@ template <class Backend, expression_template_option ExpressionTemplates, class B
 inline BOOST_MP_CXX14_CONSTEXPR bool isgreater BOOST_PREVENT_MACRO_SUBSTITUTION(const number<Backend, ExpressionTemplates>& a, const number<Backend2, ExpressionTemplates2>& b) { return a > b; }
 
 template <class Backend, expression_template_option ExpressionTemplates, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
     isgreater
     BOOST_PREVENT_MACRO_SUBSTITUTION(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b) { return a > b; }
 
 template <class Arithmetic, class Backend, expression_template_option ExpressionTemplates>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
     isgreater
     BOOST_PREVENT_MACRO_SUBSTITUTION(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b) { return a > b; }
 
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
     isgreater
     BOOST_PREVENT_MACRO_SUBSTITUTION(const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b) { return a > b; }
 
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
     isgreater
     BOOST_PREVENT_MACRO_SUBSTITUTION(const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b) { return a > b; }
 
 template <class Tag, class A1, class A2, class A3, class A4, class Tagb, class A1b, class A2b, class A3b, class A4b>
-inline BOOST_MP_CXX14_CONSTEXPR  typename enable_if<is_same<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<is_equivalent_number_type<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value, bool>::type
     isgreater
     BOOST_PREVENT_MACRO_SUBSTITUTION(const detail::expression<Tag, A1, A2, A3, A4>& a, const detail::expression<Tagb, A1b, A2b, A3b, A4b>& b) { return a > b; }
 
@@ -570,27 +666,27 @@ template <class Backend, expression_template_option ExpressionTemplates, class B
 inline BOOST_MP_CXX14_CONSTEXPR bool isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION(const number<Backend, ExpressionTemplates>& a, const number<Backend2, ExpressionTemplates2>& b) { return a >= b; }
 
 template <class Backend, expression_template_option ExpressionTemplates, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
     isgreaterequal
     BOOST_PREVENT_MACRO_SUBSTITUTION(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b) { return a >= b; }
 
 template <class Arithmetic, class Backend, expression_template_option ExpressionTemplates>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
     isgreaterequal
     BOOST_PREVENT_MACRO_SUBSTITUTION(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b) { return a >= b; }
 
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
     isgreaterequal
     BOOST_PREVENT_MACRO_SUBSTITUTION(const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b) { return a >= b; }
 
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
     isgreaterequal
     BOOST_PREVENT_MACRO_SUBSTITUTION(const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b) { return a >= b; }
 
 template <class Tag, class A1, class A2, class A3, class A4, class Tagb, class A1b, class A2b, class A3b, class A4b>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if<is_same<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<is_equivalent_number_type<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value, bool>::type
     isgreaterequal
     BOOST_PREVENT_MACRO_SUBSTITUTION(const detail::expression<Tag, A1, A2, A3, A4>& a, const detail::expression<Tagb, A1b, A2b, A3b, A4b>& b) { return a >= b; }
 
@@ -598,27 +694,27 @@ template <class Backend, expression_template_option ExpressionTemplates, class B
 inline BOOST_MP_CXX14_CONSTEXPR bool islessequal BOOST_PREVENT_MACRO_SUBSTITUTION(const number<Backend, ExpressionTemplates>& a, const number<Backend2, ExpressionTemplates2>& b) { return a <= b; }
 
 template <class Backend, expression_template_option ExpressionTemplates, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
     islessequal
     BOOST_PREVENT_MACRO_SUBSTITUTION(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b) { return a <= b; }
 
 template <class Arithmetic, class Backend, expression_template_option ExpressionTemplates>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
     islessequal
     BOOST_PREVENT_MACRO_SUBSTITUTION(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b) { return a <= b; }
 
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
     islessequal
     BOOST_PREVENT_MACRO_SUBSTITUTION(const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b) { return a <= b; }
 
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
     islessequal
     BOOST_PREVENT_MACRO_SUBSTITUTION(const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b) { return a <= b; }
 
 template <class Tag, class A1, class A2, class A3, class A4, class Tagb, class A1b, class A2b, class A3b, class A4b>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if<is_same<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<is_equivalent_number_type<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value, bool>::type
     islessequal
     BOOST_PREVENT_MACRO_SUBSTITUTION(const detail::expression<Tag, A1, A2, A3, A4>& a, const detail::expression<Tagb, A1b, A2b, A3b, A4b>& b) { return a <= b; }
 
@@ -626,27 +722,27 @@ template <class Backend, expression_template_option ExpressionTemplates, class B
 inline BOOST_MP_CXX14_CONSTEXPR bool isless BOOST_PREVENT_MACRO_SUBSTITUTION(const number<Backend, ExpressionTemplates>& a, const number<Backend2, ExpressionTemplates2>& b) { return a < b; }
 
 template <class Backend, expression_template_option ExpressionTemplates, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
     isless
     BOOST_PREVENT_MACRO_SUBSTITUTION(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b) { return a < b; }
 
 template <class Arithmetic, class Backend, expression_template_option ExpressionTemplates>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
     isless
     BOOST_PREVENT_MACRO_SUBSTITUTION(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b) { return a < b; }
 
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
     isless
     BOOST_PREVENT_MACRO_SUBSTITUTION(const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& b) { return a < b; }
 
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
     isless
     BOOST_PREVENT_MACRO_SUBSTITUTION(const detail::expression<Tag, A1, A2, A3, A4>& a, const Arithmetic& b) { return a < b; }
 
 template <class Tag, class A1, class A2, class A3, class A4, class Tagb, class A1b, class A2b, class A3b, class A4b>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if<is_same<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<is_equivalent_number_type<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value, bool>::type
     isless
     BOOST_PREVENT_MACRO_SUBSTITUTION(const detail::expression<Tag, A1, A2, A3, A4>& a, const detail::expression<Tagb, A1b, A2b, A3b, A4b>& b) { return a < b; }
 
@@ -659,7 +755,7 @@ inline BOOST_MP_CXX14_CONSTEXPR bool islessgreater BOOST_PREVENT_MACRO_SUBSTITUT
 }
 
 template <class Backend, expression_template_option ExpressionTemplates, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
     islessgreater
     BOOST_PREVENT_MACRO_SUBSTITUTION(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b)
 {
@@ -669,7 +765,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_comp
 }
 
 template <class Arithmetic, class Backend, expression_template_option ExpressionTemplates>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
     islessgreater
     BOOST_PREVENT_MACRO_SUBSTITUTION(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b)
 {
@@ -679,7 +775,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_comp
 }
 
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
     islessgreater
     BOOST_PREVENT_MACRO_SUBSTITUTION(const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& bb)
 {
@@ -688,7 +784,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_comp
 }
 
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
     islessgreater
     BOOST_PREVENT_MACRO_SUBSTITUTION(const detail::expression<Tag, A1, A2, A3, A4>& aa, const Arithmetic& b)
 {
@@ -697,7 +793,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_comp
 }
 
 template <class Tag, class A1, class A2, class A3, class A4, class Tagb, class A1b, class A2b, class A3b, class A4b>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if<is_same<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<is_equivalent_number_type<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value, bool>::type
     islessgreater
     BOOST_PREVENT_MACRO_SUBSTITUTION(const detail::expression<Tag, A1, A2, A3, A4>& aa, const detail::expression<Tagb, A1b, A2b, A3b, A4b>& bb)
 {
@@ -710,17 +806,17 @@ template <class Backend, expression_template_option ExpressionTemplates, class B
 inline BOOST_MP_CXX14_CONSTEXPR bool isunordered BOOST_PREVENT_MACRO_SUBSTITUTION(const number<Backend, ExpressionTemplates>& a, const number<Backend2, ExpressionTemplates2>& b) { return detail::is_unordered_comparison(a, b); }
 
 template <class Backend, expression_template_option ExpressionTemplates, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
     isunordered
     BOOST_PREVENT_MACRO_SUBSTITUTION(const number<Backend, ExpressionTemplates>& a, const Arithmetic& b) { return detail::is_unordered_comparison(a, b); }
 
 template <class Arithmetic, class Backend, expression_template_option ExpressionTemplates>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<number<Backend, ExpressionTemplates>, Arithmetic>::value, bool>::type
     isunordered
     BOOST_PREVENT_MACRO_SUBSTITUTION(const Arithmetic& a, const number<Backend, ExpressionTemplates>& b) { return detail::is_unordered_comparison(a, b); }
 
 template <class Arithmetic, class Tag, class A1, class A2, class A3, class A4>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
     isunordered
     BOOST_PREVENT_MACRO_SUBSTITUTION(const Arithmetic& a, const detail::expression<Tag, A1, A2, A3, A4>& bb)
 {
@@ -729,7 +825,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_comp
 }
 
 template <class Tag, class A1, class A2, class A3, class A4, class Arithmetic>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<detail::is_valid_mixed_compare<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, Arithmetic>::value, bool>::type
     isunordered
     BOOST_PREVENT_MACRO_SUBSTITUTION(const detail::expression<Tag, A1, A2, A3, A4>& aa, const Arithmetic& b)
 {
@@ -738,7 +834,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename enable_if_c<detail::is_valid_mixed_comp
 }
 
 template <class Tag, class A1, class A2, class A3, class A4, class Tagb, class A1b, class A2b, class A3b, class A4b>
-inline BOOST_MP_CXX14_CONSTEXPR typename enable_if<is_same<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>, bool>::type
+inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<is_equivalent_number_type<typename detail::expression<Tag, A1, A2, A3, A4>::result_type, typename detail::expression<Tagb, A1b, A2b, A3b, A4b>::result_type>::value, bool>::type
     isunordered
     BOOST_PREVENT_MACRO_SUBSTITUTION(const detail::expression<Tag, A1, A2, A3, A4>& aa, const detail::expression<Tagb, A1b, A2b, A3b, A4b>& bb)
 {