diff --git a/include/boost/geometry/index/detail/predicates.hpp b/include/boost/geometry/index/detail/predicates.hpp index 29e0a658f..0149d7cd4 100644 --- a/include/boost/geometry/index/detail/predicates.hpp +++ b/include/boost/geometry/index/detail/predicates.hpp @@ -43,6 +43,17 @@ struct satisfies typedef satisfies_impl::value> base; satisfies(Fun const& f) : base(f) {} + satisfies(base const& b) : base(b) {} +}; + +template +struct not_satisfies + : satisfies_impl::value> +{ + typedef satisfies_impl::value> base; + + not_satisfies(Fun const& f) : base(f) {} + not_satisfies(base const& b) : base(b) {} }; template @@ -258,6 +269,16 @@ struct predicate_check, value_tag> } }; +template +struct predicate_check, value_tag> +{ + template + static inline bool apply(not_satisfies const& p, Value const& v, Indexable const&) + { + return !p.fun(v); + } +}; + template struct predicate_check, value_tag> { @@ -458,6 +479,16 @@ struct predicate_check, bounds_tag> } }; +template +struct predicate_check, bounds_tag> +{ + template + static bool apply(not_satisfies const&, Value const&, Box const&) + { + return true; + } +}; + template struct predicate_check, bounds_tag> { diff --git a/include/boost/geometry/index/predicates.hpp b/include/boost/geometry/index/predicates.hpp index 5266621d8..a42e8665b 100644 --- a/include/boost/geometry/index/predicates.hpp +++ b/include/boost/geometry/index/predicates.hpp @@ -271,84 +271,98 @@ namespace detail { // operator! generators -template +template inline +not_satisfies +operator!(satisfies const& p) +{ + return not_satisfies(p); +} + +template inline +satisfies +operator!(not_satisfies const& p) +{ + return satisfies(p); +} + +template inline not_covered_by operator!(covered_by const& p) { return not_covered_by(p.geometry); } -template +template inline covered_by operator!(not_covered_by const& p) { return covered_by(p.geometry); } -template +template inline not_disjoint operator!(disjoint const& p) { return not_disjoint(p.geometry); } -template +template inline disjoint operator!(not_disjoint const& p) { return disjoint(p.geometry); } -template +template inline not_intersects operator!(intersects const& p) { return not_intersects(p.geometry); } -template +template inline intersects operator!(not_intersects const& p) { return intersects(p.geometry); } -template +template inline not_overlaps operator!(overlaps const& p) { return not_overlaps(p.geometry); } -template +template inline overlaps operator!(not_overlaps const& p) { return overlaps(p.geometry); } -//template +//template inline //not_touches //operator!(touches const& p) //{ // return not_touches(p.geometry); //} // -//template +//template inline //touches //operator!(not_touches const& p) //{ // return touches(p.geometry); //} -template +template inline not_within operator!(within const& p) { return not_within(p.geometry); } -template +template inline within operator!(not_within const& p) {