diff options
Diffstat (limited to 'boost/geometry/algorithms/detail/sub_range.hpp')
-rw-r--r-- | boost/geometry/algorithms/detail/sub_range.hpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/boost/geometry/algorithms/detail/sub_range.hpp b/boost/geometry/algorithms/detail/sub_range.hpp index eda3ce58ba..29edc94e6c 100644 --- a/boost/geometry/algorithms/detail/sub_range.hpp +++ b/boost/geometry/algorithms/detail/sub_range.hpp @@ -14,6 +14,9 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SUB_RANGE_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SUB_RANGE_HPP +#include <boost/mpl/if.hpp> + +#include <boost/geometry/core/assert.hpp> #include <boost/geometry/util/range.hpp> namespace boost { namespace geometry { @@ -84,7 +87,7 @@ struct sub_range<Geometry, Tag, true> template <typename Id> static inline return_type apply(Geometry & geometry, Id const& id) { - BOOST_ASSERT(0 <= id.multi_index); + BOOST_GEOMETRY_ASSERT(0 <= id.multi_index); typedef typename boost::range_size<Geometry>::type size_type; size_type const mi = static_cast<size_type>(id.multi_index); return sub_sub_range::apply(range::at(geometry, mi), id); @@ -111,6 +114,13 @@ sub_range(Geometry & geometry, Id const& id) return detail_dispatch::sub_range<Geometry>::apply(geometry, id); } +template <typename Geometry, typename Id> inline +typename sub_range_return_type<Geometry const>::type +sub_range(Geometry const& geometry, Id const& id) +{ + return detail_dispatch::sub_range<Geometry const>::apply(geometry, id); +} + } // namespace detail #endif // DOXYGEN_NO_DETAIL |