diff --git a/include/boost/geometry/algorithms/is_simple.hpp b/include/boost/geometry/algorithms/is_simple.hpp index d4572b333..ad3f48e5b 100644 --- a/include/boost/geometry/algorithms/is_simple.hpp +++ b/include/boost/geometry/algorithms/is_simple.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_IS_SIMPLE_HPP #define BOOST_GEOMETRY_ALGORITHMS_IS_SIMPLE_HPP +#include +#include +#include + #include #include #include @@ -22,10 +26,45 @@ namespace boost { namespace geometry { +namespace resolve_variant { + +template +struct is_simple +{ + static inline bool apply(Geometry const& geometry) + { + concept::check(); + return dispatch::is_simple::apply(geometry); + } +}; + +template +struct is_simple > +{ + struct visitor : boost::static_visitor + { + template + bool operator()(Geometry const& geometry) const + { + return is_simple::apply(geometry); + } + }; + + static inline bool + apply(boost::variant const& geometry) + { + return boost::apply_visitor(visitor(), geometry); + } +}; + +} // namespace resolve_variant + + + template inline bool is_simple(Geometry const& g) { - return dispatch::is_simple::apply(g); + return resolve_variant::is_simple::apply(g); }