diff options
Diffstat (limited to 'boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp')
-rw-r--r-- | boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp b/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp index 5878841e70..685a4aac35 100644 --- a/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp +++ b/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp @@ -10,6 +10,7 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_HAS_DUPLICATES_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_HAS_DUPLICATES_HPP +#include <boost/core/ignore_unused.hpp> #include <boost/range.hpp> #include <boost/geometry/core/closure.hpp> @@ -35,8 +36,13 @@ struct has_duplicates template <typename VisitPolicy> static inline bool apply(Range const& range, VisitPolicy& visitor) { + boost::ignore_unused(visitor); + typedef typename closeable_view<Range const, Closure>::type view_type; - typedef typename boost::range_iterator<view_type const>::type iterator; + typedef typename boost::range_const_iterator + < + view_type const + >::type const_iterator; view_type view(range); @@ -47,9 +53,10 @@ struct has_duplicates geometry::equal_to<typename boost::range_value<Range>::type> equal; - iterator it = boost::begin(view); - iterator next = ++boost::begin(view); - for (; next != boost::end(view); ++it, ++next) + const_iterator it = boost::const_begin(view); + const_iterator next = it; + ++next; + for (; next != boost::const_end(view); ++it, ++next) { if ( equal(*it, *next) ) { |