mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-02 08:52:10 +00:00
[algorithms][detail] Improve single_geometry() and sub_range().
Support single geometries which are returned by non-true-reference. Make the interface of sub_range() complete (Geometry const)
This commit is contained in:
@@ -46,12 +46,7 @@ struct single_geometry
|
||||
template <typename Geometry>
|
||||
struct single_geometry<Geometry, true>
|
||||
{
|
||||
typedef typename boost::mpl::if_c
|
||||
<
|
||||
boost::is_const<Geometry>::value,
|
||||
typename boost::range_value<Geometry>::type const&,
|
||||
typename boost::range_value<Geometry>::type
|
||||
>::type return_type;
|
||||
typedef typename boost::range_reference<Geometry>::type return_type;
|
||||
|
||||
template <typename Id>
|
||||
static inline return_type apply(Geometry & g, Id const& id)
|
||||
|
||||
@@ -113,6 +113,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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user