File indexing completed on 2025-01-18 09:36:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_GEOMETRY_UTIL_HAS_NON_FINITE_COORDINATE_HPP
0013 #define BOOST_GEOMETRY_UTIL_HAS_NON_FINITE_COORDINATE_HPP
0014
0015 #include <type_traits>
0016
0017 #include <boost/geometry/core/coordinate_type.hpp>
0018 #include <boost/geometry/util/has_nan_coordinate.hpp>
0019 #include <boost/math/special_functions/fpclassify.hpp>
0020
0021 namespace boost { namespace geometry
0022 {
0023
0024 #ifndef DOXYGEN_NO_DETAIL
0025 namespace detail
0026 {
0027
0028 struct is_not_finite
0029 {
0030 template <typename T>
0031 static inline bool apply(T const& t)
0032 {
0033 return ! boost::math::isfinite(t);
0034 }
0035 };
0036
0037 }
0038 #endif
0039
0040 template <typename Point>
0041 bool has_non_finite_coordinate(Point const& point)
0042 {
0043 return detail::has_coordinate_with_property
0044 <
0045 Point,
0046 detail::is_not_finite,
0047 std::is_floating_point
0048 <
0049 typename coordinate_type<Point>::type
0050 >::value
0051 >::apply(point);
0052 }
0053
0054 }}
0055
0056 #endif