3 // Copyright (c) 2017 Barend Gehrels, Amsterdam, the Netherlands.
5 // Use, modification and distribution is subject to the Boost Software License,
6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_GEOMETRY_TEST_SETOP_CHECK_VALIDITY_HPP
10 #define BOOST_GEOMETRY_TEST_SETOP_CHECK_VALIDITY_HPP
12 #include <boost/foreach.hpp>
14 #include <boost/geometry/algorithms/is_valid.hpp>
19 typename Tag = typename bg::tag<Geometry>::type
24 bool apply(Geometry const& geometry, std::string& message)
26 return bg::is_valid(geometry, message);
30 // Specialization for vector of <geometry> (e.g. rings)
31 template <typename Geometry>
32 struct check_validity<Geometry, void>
35 bool apply(Geometry const& geometry, std::string& message)
37 typedef typename boost::range_value<Geometry>::type single_type;
38 BOOST_FOREACH(single_type const& element, geometry)
40 if (! bg::is_valid(element, message))
50 #endif // BOOST_GEOMETRY_TEST_SETOP_CHECK_VALIDITY_HPP