diff --git a/include/boost/geometry/algorithms/detail/single_geometry.hpp b/include/boost/geometry/algorithms/detail/single_geometry.hpp index c9da80e16..d0646323e 100644 --- a/include/boost/geometry/algorithms/detail/single_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/single_geometry.hpp @@ -46,12 +46,7 @@ struct single_geometry template struct single_geometry { - typedef typename boost::mpl::if_c - < - boost::is_const::value, - typename boost::range_value::type const&, - typename boost::range_value::type - >::type return_type; + typedef typename boost::range_reference::type return_type; template static inline return_type apply(Geometry & g, Id const& id) diff --git a/include/boost/geometry/algorithms/detail/sub_range.hpp b/include/boost/geometry/algorithms/detail/sub_range.hpp index be499048f..6fc44c564 100644 --- a/include/boost/geometry/algorithms/detail/sub_range.hpp +++ b/include/boost/geometry/algorithms/detail/sub_range.hpp @@ -113,6 +113,13 @@ sub_range(Geometry & geometry, Id const& id) return detail_dispatch::sub_range::apply(geometry, id); } +template inline +typename sub_range_return_type::type +sub_range(Geometry const& geometry, Id const& id) +{ + return detail_dispatch::sub_range::apply(geometry, id); +} + } // namespace detail #endif // DOXYGEN_NO_DETAIL