summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp')
-rw-r--r--boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp b/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp
index 85378e08b0..7bcc0b951e 100644
--- a/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp
+++ b/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp
@@ -35,6 +35,23 @@
namespace boost { namespace geometry
{
+#if ! defined(BOOST_GEOMETRY_OVERLAY_NO_THROW)
+class inconsistent_turns_exception : public geometry::exception
+{
+public:
+
+ inline inconsistent_turns_exception() {}
+
+ virtual ~inconsistent_turns_exception() throw()
+ {}
+
+ virtual char const* what() const throw()
+ {
+ return "Boost.Geometry Inconsistent Turns exception";
+ }
+};
+#endif
+
#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace overlay
@@ -304,7 +321,14 @@ public:
oit);
}
- BOOST_ASSERT( enter_count == 0 );
+#if ! defined(BOOST_GEOMETRY_OVERLAY_NO_THROW)
+ if (enter_count != 0)
+ {
+ throw inconsistent_turns_exception();
+ }
+#else
+ BOOST_ASSERT(enter_count == 0);
+#endif
return process_end(entered, linestring,
current_segment_id, current_piece,