1 // Boost.Geometry (aka GGL, Generic Geometry Library) 2 3 // Copyright (c) 2014 Barend Gehrels, Amsterdam, the Netherlands. 4 // Copyright (c) 2014 Bruno Lalande, Paris, France. 5 // Copyright (c) 2014 Mateusz Loskot, London, UK. 6 // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland. 7 8 // Use, modification and distribution is subject to the Boost Software License, 9 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 10 // http://www.boost.org/LICENSE_1_0.txt) 11 12 #ifndef BOOST_GEOMETRY_POLICIES_ROBUSTNESS_ROBUST_TYPE_HPP 13 #define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_ROBUST_TYPE_HPP 14 15 16 #include <boost/config.hpp> 17 #include <boost/type_traits/is_floating_point.hpp> 18 19 20 namespace boost { namespace geometry 21 { 22 23 #ifndef DOXYGEN_NO_DETAIL 24 25 namespace detail_dispatch 26 { 27 28 template <typename CoordinateType, typename IsFloatingPoint> 29 struct robust_type 30 { 31 }; 32 33 template <typename CoordinateType> 34 struct robust_type<CoordinateType, boost::false_type> 35 { 36 typedef CoordinateType type; 37 }; 38 39 template <typename CoordinateType> 40 struct robust_type<CoordinateType, boost::true_type> 41 { 42 typedef boost::long_long_type type; 43 }; 44 45 } // namespace detail_dispatch 46 47 namespace detail 48 { 49 50 template <typename CoordinateType> 51 struct robust_type 52 { 53 typedef typename detail_dispatch::robust_type 54 < 55 CoordinateType, 56 typename boost::is_floating_point<CoordinateType>::type 57 >::type type; 58 }; 59 60 } // namespace detail 61 #endif // DOXYGEN_NO_DETAIL 62 63 64 }} // namespace boost::geometry 65 66 67 #endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_ROBUST_TYPE_HPP 68