From 5280f9161f2fd5a6da55fa85d157d34daba40e32 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Sun, 4 Nov 2018 15:32:11 +0100 Subject: [PATCH] Replace std::(un|bin)ary_function with CGAL::cpp98. --- Number_types/include/CGAL/boost_mp.h | 33 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/Number_types/include/CGAL/boost_mp.h b/Number_types/include/CGAL/boost_mp.h index f4811d202f3..16330489b33 100644 --- a/Number_types/include/CGAL/boost_mp.h +++ b/Number_types/include/CGAL/boost_mp.h @@ -27,6 +27,7 @@ #if BOOST_VERSION >= 105600 && !defined CGAL_DO_NOT_USE_BOOST_MP #define CGAL_USE_BOOST_MP 1 +#include // *ary_function #include #include // We can't just include all Boost.Multiprecision here... @@ -55,14 +56,14 @@ struct AST_boost_mp ::is_exact> Is_exact; typedef Tag_false Is_numerical_sensitive; - struct Is_zero: public std::unary_function { + struct Is_zero: public CGAL::cpp98::unary_function { bool operator()( const Type& x) const { return x.is_zero(); } }; struct Div: - public std::binary_function { + public CGAL::cpp98::binary_function { template Type operator()(const T& x, const U& y) const { return x / y; @@ -70,21 +71,21 @@ struct AST_boost_mp { + public CGAL::cpp98::binary_function { template Type operator()(const T& x, const U& y) const { return x % y; } }; - struct Gcd : public std::binary_function { + struct Gcd : public CGAL::cpp98::binary_function { template Type operator()(const T& x, const U& y) const { return boost::multiprecision::gcd(x, y); } }; - struct Sqrt : public std::unary_function { + struct Sqrt : public CGAL::cpp98::unary_function { template Type operator()(const T& x) const { return boost::multiprecision::sqrt(x); @@ -101,14 +102,14 @@ struct AST_boost_mp { + struct Is_zero: public CGAL::cpp98::unary_function { bool operator()( const Type& x) const { return x.is_zero(); } }; struct Div: - public std::binary_function { + public CGAL::cpp98::binary_function { template Type operator()(const T& x, const U& y) const { return x / y; @@ -124,53 +125,53 @@ struct RET_boost_mp_base typedef NT Type; - struct Is_zero: public std::unary_function { + struct Is_zero: public CGAL::cpp98::unary_function { bool operator()( const Type& x) const { return x.is_zero(); } }; - struct Is_positive: public std::unary_function { + struct Is_positive: public CGAL::cpp98::unary_function { bool operator()( const Type& x) const { return x.sign() > 0; } }; - struct Is_negative: public std::unary_function { + struct Is_negative: public CGAL::cpp98::unary_function { bool operator()( const Type& x) const { return x.sign() < 0; } }; - struct Abs : public std::unary_function { + struct Abs : public CGAL::cpp98::unary_function { template Type operator()(const T& x) const { return boost::multiprecision::abs(x); } }; - struct Sgn : public std::unary_function { + struct Sgn : public CGAL::cpp98::unary_function { ::CGAL::Sign operator()(Type const& x) const { return CGAL::sign(x.sign()); } }; struct Compare - : public std::binary_function { + : public CGAL::cpp98::binary_function { Comparison_result operator()(const Type& x, const Type& y) const { return CGAL::sign(x.compare(y)); } }; struct To_double - : public std::unary_function { + : public CGAL::cpp98::unary_function { double operator()(const Type& x) const { return x.template convert_to(); } }; struct To_interval - : public std::unary_function< Type, std::pair< double, double > > { + : public CGAL::cpp98::unary_function< Type, std::pair< double, double > > { std::pair operator()(const Type& x) const { // assume the conversion is within 1 ulp @@ -195,7 +196,7 @@ struct RET_boost_mp > { + : public CGAL::cpp98::unary_function< Type, std::pair< double, double > > { std::pair operator()(const Type& x) const { std::pair p_num = CGAL::to_interval (numerator (x));