diff --git a/include/boost/geometry/algorithms/detail/relate/result.hpp b/include/boost/geometry/algorithms/detail/relate/result.hpp index d2d9c08bc..f99625444 100644 --- a/include/boost/geometry/algorithms/detail/relate/result.hpp +++ b/include/boost/geometry/algorithms/detail/relate/result.hpp @@ -242,6 +242,13 @@ struct interrupt_dispatch, } }; +template +inline bool interrupt(Mask const& mask) +{ + return interrupt_dispatch + ::template apply(mask); +} + template struct check_dispatch { @@ -318,6 +325,12 @@ struct check_dispatch< boost::tuple > } }; +template +inline bool check(Mask const& mask, Matrix const& matrix) +{ + return check_dispatch::apply(mask, matrix); +} + template class mask_handler : private matrix @@ -337,13 +350,13 @@ public: result_type result() const { return !interrupt - && check_dispatch::apply(m_mask, static_cast(*this)); + && check(m_mask, static_cast(*this)); } template inline void set() { - if ( interrupt_dispatch::template apply(m_mask) ) + if ( relate::interrupt(m_mask) ) { interrupt = true; } @@ -395,8 +408,14 @@ struct static_should_handle_element || ( mask_el >= '0' && mask_el <= '9' ); }; -template +template struct static_interrupt_dispatch +{ + static const bool value = false; +}; + +template +struct static_interrupt_dispatch { static const char mask_el = StaticMask::template get::value; @@ -416,6 +435,7 @@ struct static_interrupt_sequence < StaticMask, V, F1, F2, + true, !boost::mpl::is_sequence::value >::value && static_interrupt_sequence @@ -433,7 +453,7 @@ struct static_interrupt_sequence }; template -struct static_interrupt_dispatch +struct static_interrupt_dispatch { static const bool value = static_interrupt_sequence @@ -444,7 +464,7 @@ struct static_interrupt_dispatch >::value; }; -template +template struct static_interrupt { static const bool value @@ -452,6 +472,7 @@ struct static_interrupt < StaticMask, V, F1, F2, + EnableInterrupt, !boost::mpl::is_sequence::value >::value; }; @@ -596,9 +617,9 @@ public: template inline void set() { - static const bool interrupt_c = static_interrupt::value; + static const bool interrupt_c = static_interrupt::value; static const bool should_handle = static_should_handle_element::value; - static const int version = Interrupt && interrupt_c ? 0 + static const int version = interrupt_c ? 0 : should_handle ? 1 : 2;