chore: modernize ring and related types to ring_t and related

This commit is contained in:
Barend Gehrels 2024-11-01 20:21:58 +01:00
parent 74b7900224
commit b98ea78b25
35 changed files with 128 additions and 152 deletions

View File

@ -381,11 +381,9 @@ struct convert<Box, Polygon, box_tag, polygon_tag, 2, false>
{ {
static inline void apply(Box const& box, Polygon& polygon) static inline void apply(Box const& box, Polygon& polygon)
{ {
typedef typename ring_type<Polygon>::type ring_type;
convert convert
< <
Box, ring_type, Box, ring_type_t<Polygon>,
box_tag, ring_tag, box_tag, ring_tag,
2, false 2, false
>::apply(box, exterior_ring(polygon)); >::apply(box, exterior_ring(polygon));
@ -415,10 +413,9 @@ struct convert<Ring, Polygon, ring_tag, polygon_tag, DimensionCount, false>
{ {
static inline void apply(Ring const& ring, Polygon& polygon) static inline void apply(Ring const& ring, Polygon& polygon)
{ {
typedef typename ring_type<Polygon>::type ring_type;
convert convert
< <
Ring, ring_type, Ring, ring_type_t<Polygon>,
ring_tag, ring_tag, ring_tag, ring_tag,
DimensionCount, false DimensionCount, false
>::apply(ring, exterior_ring(polygon)); >::apply(ring, exterior_ring(polygon));
@ -431,11 +428,9 @@ struct convert<Polygon, Ring, polygon_tag, ring_tag, DimensionCount, false>
{ {
static inline void apply(Polygon const& polygon, Ring& ring) static inline void apply(Polygon const& polygon, Ring& ring)
{ {
typedef typename ring_type<Polygon>::type ring_type;
convert convert
< <
ring_type, Ring, ring_type_t<Polygon>, Ring,
ring_tag, ring_tag, ring_tag, ring_tag,
DimensionCount, false DimensionCount, false
>::apply(exterior_ring(polygon), ring); >::apply(exterior_ring(polygon), ring);

View File

@ -747,11 +747,10 @@ template
struct buffer_inserter<polygon_tag, PolygonInput, PolygonOutput> struct buffer_inserter<polygon_tag, PolygonInput, PolygonOutput>
{ {
private: private:
typedef typename ring_type<PolygonInput>::type input_ring_type; using input_ring_type = ring_type_t<PolygonInput>;
typedef typename ring_type<PolygonOutput>::type output_ring_type; using output_ring_type = ring_type_t<PolygonOutput>;
typedef buffer_inserter_ring<input_ring_type, output_ring_type> policy;
using policy = buffer_inserter_ring<input_ring_type, output_ring_type>;
template template
< <
@ -875,7 +874,7 @@ struct buffer_inserter<multi_tag, Multi, PolygonOutput>
< <
typename single_tag_of<tag_t<Multi>>::type, typename single_tag_of<tag_t<Multi>>::type,
typename boost::range_value<Multi const>::type, typename boost::range_value<Multi const>::type,
typename geometry::ring_type<PolygonOutput>::type geometry::ring_type_t<PolygonOutput>
> >
> >
{}; {};
@ -915,7 +914,7 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
using collection_type = detail::buffer::buffered_piece_collection using collection_type = detail::buffer::buffered_piece_collection
< <
typename geometry::ring_type<GeometryOutput>::type, geometry::ring_type_t<GeometryOutput>,
Strategies, Strategies,
DistanceStrategy DistanceStrategy
>; >;

View File

@ -269,7 +269,7 @@ template<>
struct get_ring<detail::buffer::buffered_ring_collection_tag> struct get_ring<detail::buffer::buffered_ring_collection_tag>
{ {
template<typename MultiGeometry> template<typename MultiGeometry>
static inline typename ring_type<MultiGeometry>::type const& apply( static inline ring_type_t<MultiGeometry> const& apply(
ring_identifier const& id, ring_identifier const& id,
MultiGeometry const& multi_ring) MultiGeometry const& multi_ring)
{ {

View File

@ -170,7 +170,7 @@ public:
{ {
if (! disjoint_range_segment_or_box if (! disjoint_range_segment_or_box
< <
typename geometry::ring_type<Polygon>::type, geometry::ring_type_t<Polygon>,
Segment Segment
>::apply(geometry::exterior_ring(polygon), segment, strategy)) >::apply(geometry::exterior_ring(polygon), segment, strategy))
{ {

View File

@ -253,7 +253,7 @@ public:
private: private:
typedef point_to_range typedef point_to_range
< <
Point, typename ring_type<Polygon>::type, Closure, Strategies Point, ring_type_t<Polygon>, Closure, Strategies
> per_ring; > per_ring;
struct distance_to_interior_rings struct distance_to_interior_rings

View File

@ -54,8 +54,7 @@ struct envelope_polygon
template <typename Polygon, typename Box, typename Strategy> template <typename Polygon, typename Box, typename Strategy>
static inline void apply(Polygon const& polygon, Box& mbr, Strategy const& strategy) static inline void apply(Polygon const& polygon, Box& mbr, Strategy const& strategy)
{ {
typename ring_return_type<Polygon const>::type ext_ring ring_return_type_t<Polygon const> ext_ring = exterior_ring(polygon);
= exterior_ring(polygon);
if (geometry::is_empty(ext_ring)) if (geometry::is_empty(ext_ring))
{ {

View File

@ -395,9 +395,7 @@ struct polygon_collect_vectors
{ {
static inline void apply(Collection& collection, Polygon const& polygon) static inline void apply(Collection& collection, Polygon const& polygon)
{ {
typedef typename geometry::ring_type<Polygon>::type ring_type; using per_range = range_collect_vectors<geometry::ring_type_t<Polygon>, Collection>;
typedef range_collect_vectors<ring_type, Collection> per_range;
per_range::apply(collection, exterior_ring(polygon)); per_range::apply(collection, exterior_ring(polygon));
auto const& rings = interior_rings(polygon); auto const& rings = interior_rings(polygon);

View File

@ -412,11 +412,10 @@ struct extreme_points<Polygon, Dimension, polygon_tag>
static inline bool apply(Polygon const& polygon, Extremes& extremes, Intruders& intruders, static inline bool apply(Polygon const& polygon, Extremes& extremes, Intruders& intruders,
SideStrategy const& strategy) SideStrategy const& strategy)
{ {
typedef typename geometry::ring_type<Polygon>::type ring_type; using ring_implementation = detail::extreme_points::extreme_points_on_ring
typedef detail::extreme_points::extreme_points_on_ring
< <
ring_type, Dimension geometry::ring_type_t<Polygon>, Dimension
> ring_implementation; >;
if (! ring_implementation::apply(geometry::exterior_ring(polygon), if (! ring_implementation::apply(geometry::exterior_ring(polygon),
extremes, intruders, strategy)) extremes, intruders, strategy))

View File

@ -122,15 +122,14 @@ protected:
VisitPolicy& visitor, VisitPolicy& visitor,
Strategy const& strategy) Strategy const& strategy)
{ {
typedef debug_validity_phase<Polygon> debug_phase; using debug_phase = debug_validity_phase<Polygon>;
typedef typename ring_type<Polygon>::type ring_type;
// check validity of exterior ring // check validity of exterior ring
debug_phase::apply(1); debug_phase::apply(1);
if (! detail::is_valid::is_valid_ring if (! detail::is_valid::is_valid_ring
< <
ring_type, ring_type_t<Polygon>,
false // do not check self intersections false // do not check self intersections
>::apply(exterior_ring(polygon), visitor, strategy)) >::apply(exterior_ring(polygon), visitor, strategy))
{ {

View File

@ -92,7 +92,7 @@ struct copy_segment_point_polygon
// Call ring-version with the right ring // Call ring-version with the right ring
return copy_segment_point_range return copy_segment_point_range
< <
typename geometry::ring_type<Polygon>::type, geometry::ring_type_t<Polygon>,
Reverse, Reverse,
SegmentIdentifier, SegmentIdentifier,
PointOut PointOut

View File

@ -83,7 +83,7 @@ template<>
struct get_ring<polygon_tag> struct get_ring<polygon_tag>
{ {
template<typename Polygon> template<typename Polygon>
static inline typename ring_return_type<Polygon const>::type const apply( static inline ring_return_type_t<Polygon const> const apply(
ring_identifier const& id, ring_identifier const& id,
Polygon const& polygon) Polygon const& polygon)
{ {
@ -103,7 +103,7 @@ template<>
struct get_ring<multi_polygon_tag> struct get_ring<multi_polygon_tag>
{ {
template<typename MultiPolygon> template<typename MultiPolygon>
static inline typename ring_type<MultiPolygon>::type const& apply( static inline ring_type_t<MultiPolygon> const& apply(
ring_identifier const& id, ring_identifier const& id,
MultiPolygon const& multi_polygon) MultiPolygon const& multi_polygon)
{ {

View File

@ -200,13 +200,13 @@ class get_turns_in_sections
{ {
using range1_view = detail::closed_clockwise_view using range1_view = detail::closed_clockwise_view
< <
typename ring_type<Geometry1>::type const, ring_type_t<Geometry1> const,
geometry::closure<Geometry1>::value, geometry::closure<Geometry1>::value,
Reverse1 ? counterclockwise : clockwise Reverse1 ? counterclockwise : clockwise
>; >;
using range2_view = detail::closed_clockwise_view using range2_view = detail::closed_clockwise_view
< <
typename ring_type<Geometry2>::type const, ring_type_t<Geometry2> const,
geometry::closure<Geometry2>::value, geometry::closure<Geometry2>::value,
Reverse2 ? counterclockwise : clockwise Reverse2 ? counterclockwise : clockwise
>; >;
@ -740,14 +740,12 @@ struct get_turns_polygon_cs
InterruptPolicy& interrupt_policy, InterruptPolicy& interrupt_policy,
signed_size_type multi_index = -1) signed_size_type multi_index = -1)
{ {
typedef typename geometry::ring_type<Polygon>::type ring_type; using intersector_type = detail::get_turns::get_turns_cs
typedef detail::get_turns::get_turns_cs
< <
ring_type, Box, geometry::ring_type_t<Polygon>, Box,
Reverse, ReverseBox, Reverse, ReverseBox,
TurnPolicy TurnPolicy
> intersector_type; >;
intersector_type::apply( intersector_type::apply(
source_id1, geometry::exterior_ring(polygon), source_id1, geometry::exterior_ring(polygon),

View File

@ -177,14 +177,14 @@ inline OutputIterator return_if_one_input_is_empty(Geometry1 const& geometry1,
Geometry2 const& geometry2, Geometry2 const& geometry2,
OutputIterator out, Strategy const& strategy) OutputIterator out, Strategy const& strategy)
{ {
typedef typename geometry::ring_type<GeometryOut>::type ring_type; using ring_type = geometry::ring_type_t<GeometryOut>;
typedef std::deque<ring_type> ring_container_type; using ring_container_type = std::deque<ring_type>;
typedef ring_properties using properties = ring_properties
< <
geometry::point_type_t<ring_type>, geometry::point_type_t<ring_type>,
typename geometry::area_result<ring_type, Strategy>::type typename geometry::area_result<ring_type, Strategy>::type
> properties; >;
// Silence warning C4127: conditional expression is constant // Silence warning C4127: conditional expression is constant
#if defined(_MSC_VER) #if defined(_MSC_VER)
@ -256,7 +256,7 @@ struct overlay
>; >;
using turn_container_type = std::deque<turn_info>; using turn_container_type = std::deque<turn_info>;
using ring_type = typename geometry::ring_type<GeometryOut>::type; using ring_type = geometry::ring_type_t<GeometryOut>;
using ring_container_type = std::deque<ring_type>; using ring_container_type = std::deque<ring_type>;
// Define the clusters, mapping cluster_id -> turns // Define the clusters, mapping cluster_id -> turns

View File

@ -113,8 +113,7 @@ namespace dispatch
ring_identifier id, RingPropertyMap& ring_properties, ring_identifier id, RingPropertyMap& ring_properties,
Strategy const& strategy) Strategy const& strategy)
{ {
typedef typename geometry::ring_type<Polygon>::type ring_type; using per_ring = select_rings<ring_tag, geometry::ring_type_t<Polygon>>;
typedef select_rings<ring_tag, ring_type> per_ring;
per_ring::apply(exterior_ring(polygon), geometry, id, ring_properties, strategy); per_ring::apply(exterior_ring(polygon), geometry, id, ring_properties, strategy);
@ -131,8 +130,7 @@ namespace dispatch
ring_identifier id, RingPropertyMap& ring_properties, ring_identifier id, RingPropertyMap& ring_properties,
Strategy const& strategy) Strategy const& strategy)
{ {
typedef typename geometry::ring_type<Polygon>::type ring_type; using per_ring = select_rings<ring_tag, geometry::ring_type_t<Polygon>>;
typedef select_rings<ring_tag, ring_type> per_ring;
per_ring::apply(exterior_ring(polygon), id, ring_properties, strategy); per_ring::apply(exterior_ring(polygon), id, ring_properties, strategy);

View File

@ -271,7 +271,7 @@ inline bool calculate_from_inside(Geometry1 const& geometry1,
auto const& range1 = sub_range(geometry1, turn.operations[op_id].seg_id); auto const& range1 = sub_range(geometry1, turn.operations[op_id].seg_id);
using range2_view = detail::closed_clockwise_view<typename ring_type<Geometry2>::type const>; using range2_view = detail::closed_clockwise_view<ring_type_t<Geometry2> const>;
range2_view const range2(sub_range(geometry2, turn.operations[other_op_id].seg_id)); range2_view const range2(sub_range(geometry2, turn.operations[other_op_id].seg_id));
BOOST_GEOMETRY_ASSERT(boost::size(range1)); BOOST_GEOMETRY_ASSERT(boost::size(range1));

View File

@ -53,7 +53,7 @@ struct full_section_range
template <typename Polygon, typename Section> template <typename Polygon, typename Section>
struct full_section_polygon struct full_section_polygon
{ {
static inline typename ring_return_type<Polygon const>::type apply(Polygon const& polygon, Section const& section) static inline ring_return_type_t<Polygon const> apply(Polygon const& polygon, Section const& section)
{ {
return section.ring_id.ring_index < 0 return section.ring_id.ring_index < 0
? geometry::exterior_ring(polygon) ? geometry::exterior_ring(polygon)
@ -71,10 +71,10 @@ template
> >
struct full_section_multi struct full_section_multi
{ {
static inline typename ring_return_type<MultiGeometry const>::type apply( static inline ring_return_type_t<MultiGeometry const> apply(
MultiGeometry const& multi, Section const& section) MultiGeometry const& multi, Section const& section)
{ {
typedef typename boost::range_size<MultiGeometry>::type size_type; using size_type = typename boost::range_size<MultiGeometry>::type;
BOOST_GEOMETRY_ASSERT BOOST_GEOMETRY_ASSERT
( (
@ -171,7 +171,7 @@ struct range_by_section<multi_linestring_tag, MultiLinestring, Section>
\param section structure with section \param section structure with section
*/ */
template <typename Geometry, typename Section> template <typename Geometry, typename Section>
inline typename ring_return_type<Geometry const>::type inline ring_return_type_t<Geometry const>
range_by_section(Geometry const& geometry, Section const& section) range_by_section(Geometry const& geometry, Section const& section)
{ {
concepts::check<Geometry const>(); concepts::check<Geometry const>();

View File

@ -58,7 +58,7 @@ struct sub_range<Geometry, Tag, false>
template <typename Geometry> template <typename Geometry>
struct sub_range<Geometry, polygon_tag, false> struct sub_range<Geometry, polygon_tag, false>
{ {
typedef typename geometry::ring_return_type<Geometry>::type return_type; using return_type = geometry::ring_return_type_t<Geometry>;
template <typename Id> static inline template <typename Id> static inline
return_type apply(Geometry & geometry, Id const& id) return_type apply(Geometry & geometry, Id const& id)
@ -69,10 +69,10 @@ struct sub_range<Geometry, polygon_tag, false>
} }
else else
{ {
typedef typename boost::range_size using size_type = typename boost::range_size
< <
typename geometry::interior_type<Geometry>::type typename geometry::interior_type<Geometry>::type
>::type size_type; >::type;
size_type const ri = static_cast<size_type>(id.ring_index); size_type const ri = static_cast<size_type>(id.ring_index);
return range::at(geometry::interior_rings(geometry), ri); return range::at(geometry::interior_rings(geometry), ri);
} }

View File

@ -194,7 +194,7 @@ struct point_in_geometry<Polygon, polygon_tag>
{ {
int const code = point_in_geometry int const code = point_in_geometry
< <
typename ring_type<Polygon>::type ring_type_t<Polygon>
>::apply(point, exterior_ring(polygon), strategy); >::apply(point, exterior_ring(polygon), strategy);
if (code == 1) if (code == 1)
@ -204,7 +204,7 @@ struct point_in_geometry<Polygon, polygon_tag>
{ {
int const interior_code = point_in_geometry int const interior_code = point_in_geometry
< <
typename ring_type<Polygon>::type ring_type_t<Polygon>
>::apply(point, *it, strategy); >::apply(point, *it, strategy);
if (interior_code != -1) if (interior_code != -1)

View File

@ -75,12 +75,12 @@ struct perimeter<Geometry, ring_tag>
template <typename Polygon> template <typename Polygon>
struct perimeter<Polygon, polygon_tag> : detail::calculate_polygon_sum struct perimeter<Polygon, polygon_tag> : detail::calculate_polygon_sum
{ {
typedef typename default_length_result<Polygon>::type return_type; using return_type = typename default_length_result<Polygon>::type;
typedef detail::length::range_length using policy = detail::length::range_length
< <
typename ring_type<Polygon>::type, ring_type_t<Polygon>,
closure<Polygon>::value closure<Polygon>::value
> policy; >;
template <typename Strategy> template <typename Strategy>
static inline return_type apply(Polygon const& polygon, Strategy const& strategy) static inline return_type apply(Polygon const& polygon, Strategy const& strategy)

View File

@ -75,14 +75,9 @@ struct exterior_ring
template <typename Polygon> template <typename Polygon>
struct exterior_ring<polygon_tag, Polygon> struct exterior_ring<polygon_tag, Polygon>
{ {
static static geometry::ring_return_type_t<Polygon> apply(Polygon& polygon)
typename geometry::ring_return_type<Polygon>::type
apply(Polygon& polygon)
{ {
return traits::exterior_ring return traits::exterior_ring<std::remove_const_t<Polygon>>::get(polygon);
<
typename std::remove_const<Polygon>::type
>::get(polygon);
} }
}; };
@ -100,7 +95,7 @@ struct exterior_ring<polygon_tag, Polygon>
\return a reference to the exterior ring \return a reference to the exterior ring
*/ */
template <typename Polygon> template <typename Polygon>
inline typename ring_return_type<Polygon>::type exterior_ring(Polygon& polygon) inline ring_return_type_t<Polygon> exterior_ring(Polygon& polygon)
{ {
return core_dispatch::exterior_ring return core_dispatch::exterior_ring
< <
@ -121,8 +116,7 @@ inline typename ring_return_type<Polygon>::type exterior_ring(Polygon& polygon)
\qbk{distinguish,const version} \qbk{distinguish,const version}
*/ */
template <typename Polygon> template <typename Polygon>
inline typename ring_return_type<Polygon const>::type exterior_ring( inline ring_return_type_t<Polygon const> exterior_ring(Polygon const& polygon)
Polygon const& polygon)
{ {
return core_dispatch::exterior_ring return core_dispatch::exterior_ring
< <

View File

@ -90,11 +90,11 @@ struct interior_rings<polygon_tag, Polygon>
template <typename MultiPolygon> template <typename MultiPolygon>
struct interior_type<multi_polygon_tag, MultiPolygon> struct interior_type<multi_polygon_tag, MultiPolygon>
{ {
typedef typename core_dispatch::interior_type using type = typename core_dispatch::interior_type
< <
polygon_tag, polygon_tag,
typename boost::range_value<MultiPolygon>::type typename boost::range_value<MultiPolygon>::type
>::type type; >::type;
}; };
@ -113,7 +113,7 @@ struct interior_type<multi_polygon_tag, MultiPolygon>
*/ */
template <typename Polygon> template <typename Polygon>
inline typename interior_return_type<Polygon>::type interior_rings(Polygon& polygon) inline interior_return_type_t<Polygon> interior_rings(Polygon& polygon)
{ {
return core_dispatch::interior_rings return core_dispatch::interior_rings
< <
@ -134,8 +134,7 @@ inline typename interior_return_type<Polygon>::type interior_rings(Polygon& poly
\qbk{distinguish,const version} \qbk{distinguish,const version}
*/ */
template <typename Polygon> template <typename Polygon>
inline typename interior_return_type<Polygon const>::type interior_rings( inline interior_return_type_t<Polygon const> interior_rings(Polygon const& polygon)
Polygon const& polygon)
{ {
return core_dispatch::interior_rings return core_dispatch::interior_rings
< <

View File

@ -39,7 +39,7 @@ namespace traits
\par Geometries: \par Geometries:
- polygon - polygon
\par Specializations should provide: \par Specializations should provide:
- typedef X type ( e.g. std::vector&lt;myring&lt;P&gt;&gt; ) - using type = X ( e.g. std::vector&lt;myring&lt;P&gt;&gt; )
\tparam Geometry geometry \tparam Geometry geometry
*/ */
template <typename Geometry> template <typename Geometry>
@ -81,14 +81,14 @@ struct interior_return_type
template <typename Polygon> template <typename Polygon>
struct interior_return_type<polygon_tag, Polygon> struct interior_return_type<polygon_tag, Polygon>
{ {
typedef typename std::remove_const<Polygon>::type nc_polygon_type; using nc_polygon_type = std::remove_const_t<Polygon>;
typedef std::conditional_t using type = std::conditional_t
< <
std::is_const<Polygon>::value, std::is_const<Polygon>::value,
typename traits::interior_const_type<nc_polygon_type>::type, typename traits::interior_const_type<nc_polygon_type>::type,
typename traits::interior_mutable_type<nc_polygon_type>::type typename traits::interior_mutable_type<nc_polygon_type>::type
> type; >;
}; };
@ -106,10 +106,10 @@ struct interior_type
template <typename Polygon> template <typename Polygon>
struct interior_type<polygon_tag, Polygon> struct interior_type<polygon_tag, Polygon>
{ {
typedef typename std::remove_reference using type = std::remove_reference_t
< <
typename interior_return_type<polygon_tag, Polygon>::type typename interior_return_type<polygon_tag, Polygon>::type
>::type type; >;
}; };
@ -132,24 +132,32 @@ struct interior_type<polygon_tag, Polygon>
template <typename Geometry> template <typename Geometry>
struct interior_type struct interior_type
{ {
typedef typename core_dispatch::interior_type using type = typename core_dispatch::interior_type
< <
tag_t<Geometry>, tag_t<Geometry>,
Geometry Geometry
>::type type; >::type;
}; };
template <typename Geometry>
using interior_type_t = typename interior_type<Geometry>::type;
template <typename Geometry> template <typename Geometry>
struct interior_return_type struct interior_return_type
{ {
typedef typename core_dispatch::interior_return_type using type = typename core_dispatch::interior_return_type
< <
tag_t<Geometry>, tag_t<Geometry>,
Geometry Geometry
>::type type; >::type;
}; };
template <typename Geometry>
using interior_return_type_t = typename interior_return_type<Geometry>::type;
}} // namespace boost::geometry }} // namespace boost::geometry

View File

@ -66,10 +66,10 @@ template <typename Tag, typename Geometry>
struct point_type struct point_type
{ {
// Default: call traits to get point type // Default: call traits to get point type
typedef typename std::remove_const using type = std::remove_const_t
< <
typename traits::point_type<Geometry>::type typename traits::point_type<Geometry>::type
>::type type; >;
}; };
@ -77,7 +77,7 @@ struct point_type
template <typename Point> template <typename Point>
struct point_type<point_tag, Point> struct point_type<point_tag, Point>
{ {
typedef Point type; using type = Point;
}; };
@ -85,14 +85,14 @@ struct point_type<point_tag, Point>
template <typename Linestring> template <typename Linestring>
struct point_type<linestring_tag, Linestring> struct point_type<linestring_tag, Linestring>
{ {
typedef typename boost::range_value<Linestring>::type type; using type = typename boost::range_value<Linestring>::type;
}; };
template <typename Ring> template <typename Ring>
struct point_type<ring_tag, Ring> struct point_type<ring_tag, Ring>
{ {
typedef typename boost::range_value<Ring>::type type; using type = typename boost::range_value<Ring>::type;
}; };
@ -100,43 +100,43 @@ struct point_type<ring_tag, Ring>
template <typename Polygon> template <typename Polygon>
struct point_type<polygon_tag, Polygon> struct point_type<polygon_tag, Polygon>
{ {
typedef typename point_type using type = typename point_type
< <
ring_tag, ring_tag,
typename ring_type<polygon_tag, Polygon>::type typename ring_type<polygon_tag, Polygon>::type
>::type type; >::type;
}; };
template <typename MultiPoint> template <typename MultiPoint>
struct point_type<multi_point_tag, MultiPoint> struct point_type<multi_point_tag, MultiPoint>
{ {
typedef typename boost::range_value using type = typename boost::range_value
< <
MultiPoint MultiPoint
>::type type; >::type;
}; };
template <typename MultiLinestring> template <typename MultiLinestring>
struct point_type<multi_linestring_tag, MultiLinestring> struct point_type<multi_linestring_tag, MultiLinestring>
{ {
typedef typename point_type using type = typename point_type
< <
linestring_tag, linestring_tag,
typename boost::range_value<MultiLinestring>::type typename boost::range_value<MultiLinestring>::type
>::type type; >::type;
}; };
template <typename MultiPolygon> template <typename MultiPolygon>
struct point_type<multi_polygon_tag, MultiPolygon> struct point_type<multi_polygon_tag, MultiPolygon>
{ {
typedef typename point_type using type = typename point_type
< <
polygon_tag, polygon_tag,
typename boost::range_value<MultiPolygon>::type typename boost::range_value<MultiPolygon>::type
>::type type; >::type;
}; };

View File

@ -106,7 +106,7 @@ struct ring_return_type<polygon_tag, Polygon>
template <typename MultiLinestring> template <typename MultiLinestring>
struct ring_return_type<multi_linestring_tag, MultiLinestring> struct ring_return_type<multi_linestring_tag, MultiLinestring>
{ {
typedef typename ring_return_type using type = typename ring_return_type
< <
linestring_tag, linestring_tag,
std::conditional_t std::conditional_t
@ -115,14 +115,14 @@ struct ring_return_type<multi_linestring_tag, MultiLinestring>
typename boost::range_value<MultiLinestring>::type const, typename boost::range_value<MultiLinestring>::type const,
typename boost::range_value<MultiLinestring>::type typename boost::range_value<MultiLinestring>::type
> >
>::type type; >::type;
}; };
template <typename MultiPolygon> template <typename MultiPolygon>
struct ring_return_type<multi_polygon_tag, MultiPolygon> struct ring_return_type<multi_polygon_tag, MultiPolygon>
{ {
typedef typename ring_return_type using type = typename ring_return_type
< <
polygon_tag, polygon_tag,
std::conditional_t std::conditional_t
@ -131,7 +131,7 @@ struct ring_return_type<multi_polygon_tag, MultiPolygon>
typename boost::range_value<MultiPolygon>::type const, typename boost::range_value<MultiPolygon>::type const,
typename boost::range_value<MultiPolygon>::type typename boost::range_value<MultiPolygon>::type
> >
>::type type; >::type;
}; };
@ -157,30 +157,30 @@ struct ring_type<ring_tag, Ring>
template <typename Polygon> template <typename Polygon>
struct ring_type<polygon_tag, Polygon> struct ring_type<polygon_tag, Polygon>
{ {
typedef typename std::remove_reference using type = std::remove_reference_t
< <
typename ring_return_type<polygon_tag, Polygon>::type typename ring_return_type<polygon_tag, Polygon>::type
>::type type; >;
}; };
template <typename MultiLinestring> template <typename MultiLinestring>
struct ring_type<multi_linestring_tag, MultiLinestring> struct ring_type<multi_linestring_tag, MultiLinestring>
{ {
typedef typename std::remove_reference using type = std::remove_reference_t
< <
typename ring_return_type<multi_linestring_tag, MultiLinestring>::type typename ring_return_type<multi_linestring_tag, MultiLinestring>::type
>::type type; >;
}; };
template <typename MultiPolygon> template <typename MultiPolygon>
struct ring_type<multi_polygon_tag, MultiPolygon> struct ring_type<multi_polygon_tag, MultiPolygon>
{ {
typedef typename std::remove_reference using type = std::remove_reference_t
< <
typename ring_return_type<multi_polygon_tag, MultiPolygon>::type typename ring_return_type<multi_polygon_tag, MultiPolygon>::type
>::type type; >;
}; };

View File

@ -207,17 +207,17 @@ struct dsv_poly
Polygon const& poly, Polygon const& poly,
dsv_settings const& settings) dsv_settings const& settings)
{ {
typedef typename ring_type<Polygon>::type ring; using ring_t = ring_type_t<Polygon>;
os << settings.list_open; os << settings.list_open;
dsv_range<ring>::apply(os, exterior_ring(poly), settings); dsv_range<ring_t>::apply(os, exterior_ring(poly), settings);
auto const& rings = interior_rings(poly); auto const& rings = interior_rings(poly);
for (auto it = boost::begin(rings); it != boost::end(rings); ++it) for (auto it = boost::begin(rings); it != boost::end(rings); ++it)
{ {
os << settings.list_separator; os << settings.list_separator;
dsv_range<ring>::apply(os, *it, settings); dsv_range<ring_t>::apply(os, *it, settings);
} }
os << settings.list_close; os << settings.list_close;
} }

View File

@ -139,12 +139,10 @@ struct svg_poly
static inline void apply(std::basic_ostream<Char, Traits>& os, static inline void apply(std::basic_ostream<Char, Traits>& os,
Polygon const& polygon, std::string const& style, double) Polygon const& polygon, std::string const& style, double)
{ {
typedef typename geometry::ring_type<Polygon>::type ring_type;
bool first = true; bool first = true;
os << "<g fill-rule=\"evenodd\"><path d=\""; os << "<g fill-rule=\"evenodd\"><path d=\"";
ring_type const& ring = geometry::exterior_ring(polygon); auto const& ring = geometry::exterior_ring(polygon);
for (auto it = boost::begin(ring); it != boost::end(ring); ++it, first = false) for (auto it = boost::begin(ring); it != boost::end(ring); ++it, first = false)
{ {
os << (first ? "M" : " L") << " " os << (first ? "M" : " L") << " "

View File

@ -419,8 +419,7 @@ struct ring_parser
template <typename Polygon> template <typename Polygon>
struct polygon_parser struct polygon_parser
{ {
using ring_return_type = typename ring_return_type<Polygon>::type; using appender = container_appender<ring_return_type_t<Polygon>>;
using appender = container_appender<ring_return_type>;
template <typename TokenizerIterator> template <typename TokenizerIterator>
static inline void apply(TokenizerIterator& it, static inline void apply(TokenizerIterator& it,
@ -443,7 +442,7 @@ struct polygon_parser
} }
else else
{ {
typename ring_type<Polygon>::type ring; ring_type_t<Polygon> ring;
appender::apply(it, end, wkt, ring); appender::apply(it, end, wkt, ring);
range::push_back(geometry::interior_rings(poly), std::move(ring)); range::push_back(geometry::interior_rings(poly), std::move(ring));
} }

View File

@ -199,7 +199,7 @@ struct wkt_poly
static inline void apply(std::basic_ostream<Char, Traits>& os, static inline void apply(std::basic_ostream<Char, Traits>& os,
Polygon const& poly, bool force_closure) Polygon const& poly, bool force_closure)
{ {
using ring = typename ring_type<Polygon const>::type; using ring_t = ring_type_t<Polygon const>;
auto const& exterior = exterior_ring(poly); auto const& exterior = exterior_ring(poly);
auto const& rings = interior_rings(poly); auto const& rings = interior_rings(poly);
@ -215,12 +215,12 @@ struct wkt_poly
os << "("; os << "(";
if (point_count > 0) if (point_count > 0)
{ {
wkt_sequence<ring>::apply(os, exterior, force_closure); wkt_sequence<ring_t>::apply(os, exterior, force_closure);
for (auto it = boost::begin(rings); it != boost::end(rings); ++it) for (auto it = boost::begin(rings); it != boost::end(rings); ++it)
{ {
os << ","; os << ",";
wkt_sequence<ring>::apply(os, *it, force_closure); wkt_sequence<ring_t>::apply(os, *it, force_closure);
} }
} }
os << ")"; os << ")";

View File

@ -51,8 +51,8 @@ struct inner_range_type<Polygon, polygon_tag>
typedef std::conditional_t typedef std::conditional_t
< <
! std::is_const<Polygon>::value, ! std::is_const<Polygon>::value,
typename geometry::ring_type<Polygon>::type, geometry::ring_type_t<Polygon>,
typename geometry::ring_type<Polygon>::type const geometry::ring_type_t<Polygon> const
> type; > type;
}; };

View File

@ -51,14 +51,11 @@ namespace detail { namespace boundary_views
template template
< <
typename Polygon, typename Polygon,
typename Value = typename ring_type<Polygon>::type, typename Value = ring_type_t<Polygon>,
typename Reference = typename ring_return_type<Polygon>::type, typename Reference = ring_return_type_t<Polygon>,
typename Difference = typename boost::range_difference typename Difference = typename boost::range_difference
< <
typename std::remove_reference std::remove_reference_t<interior_return_type_t<Polygon>>
<
typename interior_return_type<Polygon>::type
>::type
>::type >::type
> >
class polygon_rings_iterator class polygon_rings_iterator
@ -71,13 +68,10 @@ class polygon_rings_iterator
Difference Difference
> >
{ {
typedef typename boost::range_size using size_type = typename boost::range_size
< <
typename std::remove_reference std::remove_reference_t<interior_return_type_t<Polygon>>
< >::type;
typename interior_return_type<Polygon>::type
>::type
>::type size_type;
public: public:
// default constructor // default constructor
@ -328,7 +322,7 @@ public:
template <typename Areal> template <typename Areal>
class areal_boundary class areal_boundary
{ {
typedef boundary_view<typename ring_type<Areal>::type> boundary_view_type; typedef boundary_view<ring_type_t<Areal>> boundary_view_type;
typedef views_container_initializer<Areal> exception_safe_initializer; typedef views_container_initializer<Areal> exception_safe_initializer;
template <typename T> template <typename T>

View File

@ -355,9 +355,9 @@ struct test_distance_of_geometries
> >
: public test_distance_of_geometries<Segment, Polygon, 0, 0> : public test_distance_of_geometries<Segment, Polygon, 0, 0>
{ {
typedef test_distance_of_geometries<Segment, Polygon, 0, 0> base; using base = test_distance_of_geometries<Segment, Polygon, 0, 0>;
typedef typename bg::ring_type<Polygon>::type ring_type; using ring_type = bg::ring_type_t<Polygon>;
template template
< <
@ -462,7 +462,7 @@ struct test_distance_of_geometries
> >
: public test_distance_of_geometries<Segment, Box, 0, 0> : public test_distance_of_geometries<Segment, Box, 0, 0>
{ {
typedef test_distance_of_geometries<Segment, Box, 0, 0> base; using base = test_distance_of_geometries<Segment, Box, 0, 0>;
template template
< <

View File

@ -39,9 +39,8 @@ void test_dissolve_plusmin(std::string const& caseid, Collection const& input,
T const& expected_positive_area, T const& expected_positive_area,
T const& expected_negative_area) T const& expected_negative_area)
{ {
typedef typename boost::range_value<GeometryOut>::type geometry_type; using geometry_type = typename boost::range_value<GeometryOut>::type;
typedef typename bg::point_type<geometry_type>::type point_type; using point_type = bg::point_type_t<geometry_type>;
GeometryOut output; GeometryOut output;
bg::dissolver(input, output); bg::dissolver(input, output);
@ -117,8 +116,8 @@ void test_geometry(std::string const& caseid, std::string const& wkt,
// Test std::vector<ring> // Test std::vector<ring>
{ {
typedef typename boost::range_value<MultiPolygon>::type polygon_type; using polygon_type = typename boost::range_value<MultiPolygon>::type;
typedef typename bg::ring_type<MultiPolygon>::type ring_type; using ring_type = bg::ring_type_t<MultiPolygon>;
std::vector<ring_type> rings; std::vector<ring_type> rings;
for (polygon_type const& polygon : multi_polygon) for (polygon_type const& polygon : multi_polygon)
{ {
@ -163,8 +162,8 @@ void test_geometry(std::string const& caseid, std::string const& wkt,
template <typename Point> template <typename Point>
void test_all() void test_all()
{ {
typedef bg::model::polygon<Point> polygon; using polygon = bg::model::polygon<Point>;
typedef bg::model::multi_polygon<polygon> multi_polygon; using multi_polygon = bg::model::multi_polygon<polygon>;
test_geometry<multi_polygon>("simplex_one", test_geometry<multi_polygon>("simplex_one",
"MULTIPOLYGON(((0 0,1 4,4 1,0 0)))", "MULTIPOLYGON(((0 0,1 4,4 1,0 0)))",

View File

@ -47,7 +47,7 @@ struct test_split_rings
double precision) double precision)
{ {
typedef typename bg::ring_type<Geometry>::type ring_type; using ring_type = bg::ring_type_t<Geometry>:;
std::vector<ring_type> rings; std::vector<ring_type> rings;
bg::split_rings(geometry, rings); bg::split_rings(geometry, rings);

View File

@ -52,9 +52,9 @@ void test_ring(std::string const& wkt,
std::size_t expected_interior_ring_count, std::size_t expected_interior_ring_count,
std::size_t expected_first_interior_count) std::size_t expected_first_interior_count)
{ {
typedef bg::model::polygon<P> the_polygon; using the_polygon = bg::model::polygon<P>;
typedef typename bg::ring_type<the_polygon>::type the_ring; using the_ring = bg::ring_type_t<the_polygon>;
typedef typename bg::interior_return_type<the_polygon const>::type the_interior; using the_interior = bg::interior_return_type_t<the_polygon const>;
the_polygon poly; the_polygon poly;
bg::read_wkt(wkt, poly); bg::read_wkt(wkt, poly);

View File

@ -23,7 +23,7 @@ inline void make_square_polygon(Polygon& polygon, Generator& generator, Settings
x = generator(); x = generator();
y = generator(); y = generator();
typename ring_type<Polygon>::type& ring = exterior_ring(polygon); auto& ring = exterior_ring(polygon);
point_type p; point_type p;
set<0>(p, x); set<1>(p, y); append(ring, p); set<0>(p, x); set<1>(p, y); append(ring, p);