diff --git a/include/boost/geometry/algorithms/detail/interior_iterator.hpp b/include/boost/geometry/algorithms/detail/interior_iterator.hpp index fd5a4189c..7ae369399 100644 --- a/include/boost/geometry/algorithms/detail/interior_iterator.hpp +++ b/include/boost/geometry/algorithms/detail/interior_iterator.hpp @@ -9,8 +9,12 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERIOR_ITERATOR_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERIOR_ITERATOR_HPP -#include +#include #include +#include +#include + +#include namespace boost { namespace geometry { @@ -33,6 +37,33 @@ struct interior_iterator >::type type; }; +template +struct const_conformant +{ + typedef typename boost::mpl::if_ + < + boost::is_const, + T const, + T + >::type type; +}; + +template +struct interior_ring_iterator +{ + typedef typename boost::range_iterator + < + typename const_conformant + < + typename geometry::interior_type::type, + typename boost::range_value + < + typename geometry::interior_type::type + >::type + >::type + >::type type; +}; + } // namespace detail #endif // DOXYGEN_NO_DETAIL diff --git a/include/boost/geometry/io/dsv/write.hpp b/include/boost/geometry/io/dsv/write.hpp index fe1bb3672..8b5f604b1 100644 --- a/include/boost/geometry/io/dsv/write.hpp +++ b/include/boost/geometry/io/dsv/write.hpp @@ -20,7 +20,8 @@ #include #include -#include + +#include #include #include @@ -210,9 +211,10 @@ struct dsv_poly dsv_range::apply(os, exterior_ring(poly), settings); - typename interior_return_type::type rings - = interior_rings(poly); - for (BOOST_AUTO_TPL(it, boost::begin(rings)); it != boost::end(rings); ++it) + typename interior_return_type::type + rings = interior_rings(poly); + for (typename detail::interior_iterator::type + it = boost::begin(rings); it != boost::end(rings); ++it) { os << settings.list_separator; dsv_range::apply(os, *it, settings); diff --git a/include/boost/geometry/io/svg/write_svg.hpp b/include/boost/geometry/io/svg/write_svg.hpp index 15fa9c11c..8f6d44766 100644 --- a/include/boost/geometry/io/svg/write_svg.hpp +++ b/include/boost/geometry/io/svg/write_svg.hpp @@ -18,8 +18,8 @@ #include #include #include -#include +#include #include #include @@ -135,13 +135,14 @@ struct svg_poly // Inner rings: { - typename interior_return_type::type rings - = interior_rings(polygon); - for (BOOST_AUTO_TPL(rit, boost::begin(rings)); - rit != boost::end(rings); ++rit) + typename interior_return_type::type + rings = interior_rings(polygon); + for (typename detail::interior_iterator::type + rit = boost::begin(rings); rit != boost::end(rings); ++rit) { first = true; - for (BOOST_AUTO_TPL(it, boost::begin(*rit)); it != boost::end(*rit); + for (typename detail::interior_ring_iterator::type + it = boost::begin(*rit); it != boost::end(*rit); ++it, first = false) { os << (first ? "M" : " L") << " " diff --git a/include/boost/geometry/io/wkt/write.hpp b/include/boost/geometry/io/wkt/write.hpp index 23ed375de..1cc5cc57e 100644 --- a/include/boost/geometry/io/wkt/write.hpp +++ b/include/boost/geometry/io/wkt/write.hpp @@ -19,11 +19,11 @@ #include #include -#include #include #include #include +#include #include #include #include @@ -197,9 +197,10 @@ struct wkt_poly os << "("; wkt_sequence::apply(os, exterior_ring(poly), force_closed); - typename interior_return_type::type rings - = interior_rings(poly); - for (BOOST_AUTO_TPL(it, boost::begin(rings)); it != boost::end(rings); ++it) + typename interior_return_type::type + rings = interior_rings(poly); + for (typename detail::interior_iterator::type + it = boost::begin(rings); it != boost::end(rings); ++it) { os << ","; wkt_sequence::apply(os, *it, force_closed);