1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #ifndef BOOST_GEOMETRY_UTIL_HAS_INFINITE_COORDINATE_HPP
- #define BOOST_GEOMETRY_UTIL_HAS_INFINITE_COORDINATE_HPP
- #include <type_traits>
- #include <boost/geometry/core/coordinate_type.hpp>
- #include <boost/geometry/util/has_nan_coordinate.hpp>
- #include <boost/math/special_functions/fpclassify.hpp>
- namespace boost { namespace geometry
- {
- #ifndef DOXYGEN_NO_DETAIL
- namespace detail
- {
- struct isinf
- {
- template <typename T>
- static inline bool apply(T const& t)
- {
- return boost::math::isinf(t);
- }
- };
- }
- #endif
- template <typename Point>
- bool has_infinite_coordinate(Point const& point)
- {
- return detail::has_coordinate_with_property
- <
- Point,
- detail::isinf,
- std::is_floating_point
- <
- typename coordinate_type<Point>::type
- >::value
- >::apply(point);
- }
- }}
- #endif
|