123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_THROW_ON_EMPTY_INPUT_HPP
- #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_THROW_ON_EMPTY_INPUT_HPP
- #include <boost/geometry/core/exception.hpp>
- #include <boost/geometry/algorithms/is_empty.hpp>
- #include <boost/throw_exception.hpp>
- #if defined(BOOST_GEOMETRY_EMPTY_INPUT_NO_THROW)
- #include <boost/core/ignore_unused.hpp>
- #endif
- namespace boost { namespace geometry
- {
- #ifndef DOXYGEN_NO_DETAIL
- namespace detail
- {
- template <typename Geometry>
- inline void throw_on_empty_input(Geometry const& geometry)
- {
- #if ! defined(BOOST_GEOMETRY_EMPTY_INPUT_NO_THROW)
- if (geometry::is_empty(geometry))
- {
- BOOST_THROW_EXCEPTION(empty_input_exception());
- }
- #else
- boost::ignore_unused(geometry);
- #endif
- }
- }
- #endif
- }}
- #endif
|