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)
{
typedef typename ring_type<Polygon>::type ring_type;
convert
<
Box, ring_type,
Box, ring_type_t<Polygon>,
box_tag, ring_tag,
2, false
>::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)
{
typedef typename ring_type<Polygon>::type ring_type;
convert
<
Ring, ring_type,
Ring, ring_type_t<Polygon>,
ring_tag, ring_tag,
DimensionCount, false
>::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)
{
typedef typename ring_type<Polygon>::type ring_type;
convert
<
ring_type, Ring,
ring_type_t<Polygon>, Ring,
ring_tag, ring_tag,
DimensionCount, false
>::apply(exterior_ring(polygon), ring);

View File

@ -747,11 +747,10 @@ template
struct buffer_inserter<polygon_tag, PolygonInput, PolygonOutput>
{
private:
typedef typename ring_type<PolygonInput>::type input_ring_type;
typedef typename ring_type<PolygonOutput>::type output_ring_type;
typedef buffer_inserter_ring<input_ring_type, output_ring_type> policy;
using input_ring_type = ring_type_t<PolygonInput>;
using output_ring_type = ring_type_t<PolygonOutput>;
using policy = buffer_inserter_ring<input_ring_type, output_ring_type>;
template
<
@ -875,7 +874,7 @@ struct buffer_inserter<multi_tag, Multi, PolygonOutput>
<
typename single_tag_of<tag_t<Multi>>::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
<
typename geometry::ring_type<GeometryOutput>::type,
geometry::ring_type_t<GeometryOutput>,
Strategies,
DistanceStrategy
>;

View File

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

View File

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

View File

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

View File

@ -54,8 +54,7 @@ struct envelope_polygon
template <typename Polygon, typename Box, typename Strategy>
static inline void apply(Polygon const& polygon, Box& mbr, Strategy const& strategy)
{
typename ring_return_type<Polygon const>::type ext_ring
= exterior_ring(polygon);
ring_return_type_t<Polygon const> ext_ring = exterior_ring(polygon);
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)
{
typedef typename geometry::ring_type<Polygon>::type ring_type;
typedef range_collect_vectors<ring_type, Collection> per_range;
using per_range = range_collect_vectors<geometry::ring_type_t<Polygon>, Collection>;
per_range::apply(collection, exterior_ring(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,
SideStrategy const& strategy)
{
typedef typename geometry::ring_type<Polygon>::type ring_type;
typedef detail::extreme_points::extreme_points_on_ring
using ring_implementation = detail::extreme_points::extreme_points_on_ring
<
ring_type, Dimension
> ring_implementation;
geometry::ring_type_t<Polygon>, Dimension
>;
if (! ring_implementation::apply(geometry::exterior_ring(polygon),
extremes, intruders, strategy))

View File

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

View File

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

View File

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

View File

@ -200,13 +200,13 @@ class get_turns_in_sections
{
using range1_view = detail::closed_clockwise_view
<
typename ring_type<Geometry1>::type const,
ring_type_t<Geometry1> const,
geometry::closure<Geometry1>::value,
Reverse1 ? counterclockwise : clockwise
>;
using range2_view = detail::closed_clockwise_view
<
typename ring_type<Geometry2>::type const,
ring_type_t<Geometry2> const,
geometry::closure<Geometry2>::value,
Reverse2 ? counterclockwise : clockwise
>;
@ -740,14 +740,12 @@ struct get_turns_polygon_cs
InterruptPolicy& interrupt_policy,
signed_size_type multi_index = -1)
{
typedef typename geometry::ring_type<Polygon>::type ring_type;
typedef detail::get_turns::get_turns_cs
using intersector_type = detail::get_turns::get_turns_cs
<
ring_type, Box,
geometry::ring_type_t<Polygon>, Box,
Reverse, ReverseBox,
TurnPolicy
> intersector_type;
>;
intersector_type::apply(
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,
OutputIterator out, Strategy const& strategy)
{
typedef typename geometry::ring_type<GeometryOut>::type ring_type;
typedef std::deque<ring_type> ring_container_type;
using ring_type = geometry::ring_type_t<GeometryOut>;
using ring_container_type = std::deque<ring_type>;
typedef ring_properties
using properties = ring_properties
<
geometry::point_type_t<ring_type>,
typename geometry::area_result<ring_type, Strategy>::type
> properties;
>;
// Silence warning C4127: conditional expression is constant
#if defined(_MSC_VER)
@ -256,7 +256,7 @@ struct overlay
>;
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>;
// Define the clusters, mapping cluster_id -> turns

View File

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

View File

@ -53,7 +53,7 @@ struct full_section_range
template <typename Polygon, typename Section>
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
? geometry::exterior_ring(polygon)
@ -71,10 +71,10 @@ template
>
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)
{
typedef typename boost::range_size<MultiGeometry>::type size_type;
using size_type = typename boost::range_size<MultiGeometry>::type;
BOOST_GEOMETRY_ASSERT
(
@ -171,7 +171,7 @@ struct range_by_section<multi_linestring_tag, MultiLinestring, Section>
\param section structure with 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)
{
concepts::check<Geometry const>();

View File

@ -58,7 +58,7 @@ struct sub_range<Geometry, Tag, false>
template <typename Geometry>
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
return_type apply(Geometry & geometry, Id const& id)
@ -69,10 +69,10 @@ struct sub_range<Geometry, polygon_tag, false>
}
else
{
typedef typename boost::range_size
using size_type = typename boost::range_size
<
typename geometry::interior_type<Geometry>::type
>::type size_type;
>::type;
size_type const ri = static_cast<size_type>(id.ring_index);
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
<
typename ring_type<Polygon>::type
ring_type_t<Polygon>
>::apply(point, exterior_ring(polygon), strategy);
if (code == 1)
@ -204,7 +204,7 @@ struct point_in_geometry<Polygon, polygon_tag>
{
int const interior_code = point_in_geometry
<
typename ring_type<Polygon>::type
ring_type_t<Polygon>
>::apply(point, *it, strategy);
if (interior_code != -1)

View File

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

View File

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

View File

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

View File

@ -39,7 +39,7 @@ namespace traits
\par Geometries:
- polygon
\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
*/
template <typename Geometry>
@ -81,14 +81,14 @@ struct interior_return_type
template <typename 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,
typename traits::interior_const_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>
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
>::type type;
>;
};
@ -132,24 +132,32 @@ struct interior_type<polygon_tag, Polygon>
template <typename Geometry>
struct interior_type
{
typedef typename core_dispatch::interior_type
using type = typename core_dispatch::interior_type
<
tag_t<Geometry>,
Geometry
>::type type;
>::type;
};
template <typename Geometry>
using interior_type_t = typename interior_type<Geometry>::type;
template <typename Geometry>
struct interior_return_type
{
typedef typename core_dispatch::interior_return_type
using type = typename core_dispatch::interior_return_type
<
tag_t<Geometry>,
Geometry
>::type type;
>::type;
};
template <typename Geometry>
using interior_return_type_t = typename interior_return_type<Geometry>::type;
}} // namespace boost::geometry

View File

@ -66,10 +66,10 @@ template <typename Tag, typename Geometry>
struct 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
>::type type;
>;
};
@ -77,7 +77,7 @@ struct point_type
template <typename 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>
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>
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>
struct point_type<polygon_tag, Polygon>
{
typedef typename point_type
using type = typename point_type
<
ring_tag,
typename ring_type<polygon_tag, Polygon>::type
>::type type;
>::type;
};
template <typename MultiPoint>
struct point_type<multi_point_tag, MultiPoint>
{
typedef typename boost::range_value
using type = typename boost::range_value
<
MultiPoint
>::type type;
>::type;
};
template <typename MultiLinestring>
struct point_type<multi_linestring_tag, MultiLinestring>
{
typedef typename point_type
using type = typename point_type
<
linestring_tag,
typename boost::range_value<MultiLinestring>::type
>::type type;
>::type;
};
template <typename MultiPolygon>
struct point_type<multi_polygon_tag, MultiPolygon>
{
typedef typename point_type
using type = typename point_type
<
polygon_tag,
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>
struct ring_return_type<multi_linestring_tag, MultiLinestring>
{
typedef typename ring_return_type
using type = typename ring_return_type
<
linestring_tag,
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
>
>::type type;
>::type;
};
template <typename MultiPolygon>
struct ring_return_type<multi_polygon_tag, MultiPolygon>
{
typedef typename ring_return_type
using type = typename ring_return_type
<
polygon_tag,
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
>
>::type type;
>::type;
};
@ -157,30 +157,30 @@ struct ring_type<ring_tag, Ring>
template <typename 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
>::type type;
>;
};
template <typename 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
>::type type;
>;
};
template <typename 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
>::type type;
>;
};

View File

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

View File

@ -139,12 +139,10 @@ struct svg_poly
static inline void apply(std::basic_ostream<Char, Traits>& os,
Polygon const& polygon, std::string const& style, double)
{
typedef typename geometry::ring_type<Polygon>::type ring_type;
bool first = true;
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)
{
os << (first ? "M" : " L") << " "

View File

@ -419,8 +419,7 @@ struct ring_parser
template <typename Polygon>
struct polygon_parser
{
using ring_return_type = typename ring_return_type<Polygon>::type;
using appender = container_appender<ring_return_type>;
using appender = container_appender<ring_return_type_t<Polygon>>;
template <typename TokenizerIterator>
static inline void apply(TokenizerIterator& it,
@ -443,7 +442,7 @@ struct polygon_parser
}
else
{
typename ring_type<Polygon>::type ring;
ring_type_t<Polygon> ring;
appender::apply(it, end, wkt, 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,
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& rings = interior_rings(poly);
@ -215,12 +215,12 @@ struct wkt_poly
os << "(";
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)
{
os << ",";
wkt_sequence<ring>::apply(os, *it, force_closure);
wkt_sequence<ring_t>::apply(os, *it, force_closure);
}
}
os << ")";

View File

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

View File

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

View File

@ -355,9 +355,9 @@ struct test_distance_of_geometries
>
: 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
<
@ -462,7 +462,7 @@ struct test_distance_of_geometries
>
: 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
<

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_negative_area)
{
typedef typename boost::range_value<GeometryOut>::type geometry_type;
typedef typename bg::point_type<geometry_type>::type point_type;
using geometry_type = typename boost::range_value<GeometryOut>::type;
using point_type = bg::point_type_t<geometry_type>;
GeometryOut output;
bg::dissolver(input, output);
@ -117,8 +116,8 @@ void test_geometry(std::string const& caseid, std::string const& wkt,
// Test std::vector<ring>
{
typedef typename boost::range_value<MultiPolygon>::type polygon_type;
typedef typename bg::ring_type<MultiPolygon>::type ring_type;
using polygon_type = typename boost::range_value<MultiPolygon>::type;
using ring_type = bg::ring_type_t<MultiPolygon>;
std::vector<ring_type> rings;
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>
void test_all()
{
typedef bg::model::polygon<Point> polygon;
typedef bg::model::multi_polygon<polygon> multi_polygon;
using polygon = bg::model::polygon<Point>;
using multi_polygon = bg::model::multi_polygon<polygon>;
test_geometry<multi_polygon>("simplex_one",
"MULTIPOLYGON(((0 0,1 4,4 1,0 0)))",

View File

@ -47,7 +47,7 @@ struct test_split_rings
double precision)
{
typedef typename bg::ring_type<Geometry>::type ring_type;
using ring_type = bg::ring_type_t<Geometry>:;
std::vector<ring_type> 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_first_interior_count)
{
typedef bg::model::polygon<P> the_polygon;
typedef typename bg::ring_type<the_polygon>::type the_ring;
typedef typename bg::interior_return_type<the_polygon const>::type the_interior;
using the_polygon = bg::model::polygon<P>;
using the_ring = bg::ring_type_t<the_polygon>;
using the_interior = bg::interior_return_type_t<the_polygon const>;
the_polygon poly;
bg::read_wkt(wkt, poly);

View File

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