From 43eed0a3ba30a5edff1beaf061d4aa7cef5df3fa Mon Sep 17 00:00:00 2001 From: Jeremiah Willcock Date: Fri, 3 Apr 2009 14:55:01 +0000 Subject: [PATCH] Trying to fix Sun CC 5.9 error by fully qualifying root_two [SVN r52157] --- include/boost/graph/topology.hpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/include/boost/graph/topology.hpp b/include/boost/graph/topology.hpp index e2632292..f6d74f38 100644 --- a/include/boost/graph/topology.hpp +++ b/include/boost/graph/topology.hpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include // For root_two #include #include // For BOOST_STATIC_CONSTANT #include @@ -42,6 +42,7 @@ class convex_topology double values[Dims]; }; + friend struct point_difference; // Workaround for VisualAge C++ bug struct point_difference { BOOST_STATIC_CONSTANT(std::size_t, dimensions = Dims); @@ -438,14 +439,13 @@ class heart_topology { #ifndef BOOST_NO_STDC_NAMESPACE using std::abs; - using boost::math::constants::root_two; #endif if (p[1] < abs(p[0]) - 2000) return false; // Bottom if (p[1] <= -1000) return true; // Diagonal of square - if (boost::math::hypot(p[0] - -500, p[1] - -500) <= 500. * root_two()) + if (boost::math::hypot(p[0] - -500, p[1] - -500) <= 500. * boost::math::constants::root_two()) return true; // Left circle - if (boost::math::hypot(p[0] - 500, p[1] - -500) <= 500. * root_two()) + if (boost::math::hypot(p[0] - 500, p[1] - -500) <= 500. * boost::math::constants::root_two()) return true; // Right circle return false; } @@ -475,10 +475,9 @@ class heart_topology point random_point() const { point result; - using boost::math::constants::root_two; do { - result[0] = (*rand)() * (1000 + 1000 * root_two()) - (500 + 500 * root_two()); - result[1] = (*rand)() * (2000 + 500 * (root_two() - 1)) - 2000; + result[0] = (*rand)() * (1000 + 1000 * boost::math::constants::root_two()) - (500 + 500 * boost::math::constants::root_two()); + result[1] = (*rand)() * (2000 + 500 * (boost::math::constants::root_two() - 1)) - 2000; } while (!in_heart(result)); return result; }