diff options
Diffstat (limited to 'libs/geometry/test/strategies/pythagoras.cpp')
-rw-r--r-- | libs/geometry/test/strategies/pythagoras.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/libs/geometry/test/strategies/pythagoras.cpp b/libs/geometry/test/strategies/pythagoras.cpp index b8bcfed3c..3b81bf144 100644 --- a/libs/geometry/test/strategies/pythagoras.cpp +++ b/libs/geometry/test/strategies/pythagoras.cpp @@ -20,7 +20,6 @@ #endif #include <boost/timer.hpp> -#include <boost/typeof/typeof.hpp> #include <boost/concept/requires.hpp> #include <boost/concept_check.hpp> @@ -239,21 +238,28 @@ void test_integer(bool check_types) bg::assign_values(p2, 98765432, 87654321); typedef bg::strategy::distance::pythagoras<> pythagoras_type; - pythagoras_type pythagoras; - BOOST_AUTO(distance, pythagoras.apply(p1, p2)); - BOOST_CHECK_CLOSE(distance, 107655455.02347542, 0.001); - typedef typename bg::strategy::distance::services::comparable_type < pythagoras_type >::type comparable_type; + + typedef typename bg::strategy::distance::services::return_type + < + pythagoras_type, point_type, point_type + >::type distance_type; + typedef typename bg::strategy::distance::services::return_type + < + comparable_type, point_type, point_type + >::type cdistance_type; + + pythagoras_type pythagoras; + distance_type distance = pythagoras.apply(p1, p2); + BOOST_CHECK_CLOSE(distance, 107655455.02347542, 0.001); + comparable_type comparable; - BOOST_AUTO(cdistance, comparable.apply(p1, p2)); + cdistance_type cdistance = comparable.apply(p1, p2); BOOST_CHECK_EQUAL(cdistance, 11589696996311540); - typedef BOOST_TYPEOF(cdistance) cdistance_type; - typedef BOOST_TYPEOF(distance) distance_type; - distance_type distance2 = sqrt(distance_type(cdistance)); BOOST_CHECK_CLOSE(distance, distance2, 0.001); |