From 83ce38c57f88d76eeabc4c0a7785b93f399d673f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 3 Aug 2006 03:37:56 +0000 Subject: [PATCH] fix min/max problem --- .../include/CGAL/Random_convex_set_traits_2.h | 5 ++++- Generator/include/CGAL/point_generators_2.h | 20 ++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Generator/include/CGAL/Random_convex_set_traits_2.h b/Generator/include/CGAL/Random_convex_set_traits_2.h index 959ec1ecfd4..552ca8960b9 100644 --- a/Generator/include/CGAL/Random_convex_set_traits_2.h +++ b/Generator/include/CGAL/Random_convex_set_traits_2.h @@ -47,7 +47,10 @@ struct Random_convex_set_traits_2 { { FT operator()( const Point_2& p) const - { return max( CGAL_NTS abs( p.x()), CGAL_NTS abs( p.y())); } + { + BOOST_USING_STD_MAX(); + return max BOOST_PREVENT_MACRO_SUBSTITUTION ( CGAL_NTS abs( p.x()), CGAL_NTS abs( p.y())); + } }; struct Sum diff --git a/Generator/include/CGAL/point_generators_2.h b/Generator/include/CGAL/point_generators_2.h index 07c27738a7a..8732124c9ef 100644 --- a/Generator/include/CGAL/point_generators_2.h +++ b/Generator/include/CGAL/point_generators_2.h @@ -201,10 +201,13 @@ public: // distributed on the segment from p to q except q, i.e. `*g' == // \lambda p + (1-\lambda)\, q where 0 <= \lambda < 1 . A single // random number is needed from `rnd' for each point. - : Random_generator_base

( max( max( to_double(p.x()), to_double(q.x())), - max( to_double(p.y()), - to_double(q.y()))), - rnd) , _p(p), _q(q) { + : Random_generator_base

( max BOOST_PREVENT_MACRO_SUBSTITUTION + ( max BOOST_PREVENT_MACRO_SUBSTITUTION + ( to_double(p.x()), to_double(q.x())), + max BOOST_PREVENT_MACRO_SUBSTITUTION + ( to_double(p.y()), + to_double(q.y()))), + rnd) , _p(p), _q(q) { generate_point(); } const P& source() const { return _p; } @@ -244,9 +247,12 @@ public: Points_on_segment_2() {} Points_on_segment_2( const P& p, const P& q, std::size_t mx, std::size_t i = 0) - : Generator_base

( max( max( to_double(p.x()), to_double(q.x())), - max( to_double(p.y()), to_double(q.y())))), - _p(p), _q(q), d_i(i), d_mx(mx) { + : Generator_base

( max BOOST_PREVENT_MACRO_SUBSTITUTION + ( max BOOST_PREVENT_MACRO_SUBSTITUTION + ( to_double(p.x()), to_double(q.x())), + max BOOST_PREVENT_MACRO_SUBSTITUTION + ( to_double(p.y()), to_double(q.y())))), + _p(p), _q(q), d_i(i), d_mx(mx) { generate_point(); } const P& source() const { return _p; }