Skip to content

Commit

Permalink
chore: modernize codebase by replacing typedef with using
Browse files Browse the repository at this point in the history
  • Loading branch information
vissarion committed Oct 22, 2024
1 parent 19f22c2 commit 8ca368c
Show file tree
Hide file tree
Showing 439 changed files with 1,758 additions and 2,587 deletions.
2 changes: 1 addition & 1 deletion include/boost/geometry/algorithms/area_result.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct area_result
template <typename Geometry, typename Strategy>
struct area_result<Geometry, Strategy, false>
{
typedef typename Strategy::template result_type<Geometry>::type type;
using type = typename Strategy::template result_type<Geometry>::type;
};


Expand Down
5 changes: 1 addition & 4 deletions include/boost/geometry/algorithms/centroid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,7 @@ struct centroid_indexed
static inline void apply(Indexed const& indexed, Point& centroid,
Strategy const&)
{
typedef typename select_coordinate_type
<
Indexed, Point
>::type coordinate_type;
using coordinate_type = int;

detail::for_each_dimension<Indexed>([&](auto dimension)
{
Expand Down
10 changes: 5 additions & 5 deletions include/boost/geometry/algorithms/detail/assign_values.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct assign_zero_point
template <typename Point>
static inline void apply(Point& point)
{
typedef typename coordinate_type<Point>::type coordinate_type;
using coordinate_type = int;

coordinate_type const zero = 0;
detail::for_each_dimension<Point>([&](auto dimension)
Expand All @@ -71,7 +71,7 @@ struct assign_inverse_box_or_segment
template <typename BoxOrSegment>
static inline void apply(BoxOrSegment& geometry)
{
typedef typename coordinate_type<BoxOrSegment>::type coordinate_type;
using coordinate_type = int;

coordinate_type const highest = util::bounds<coordinate_type>::highest();
coordinate_type const lowest = util::bounds<coordinate_type>::lowest();
Expand All @@ -90,7 +90,7 @@ struct assign_zero_box_or_segment
template <typename BoxOrSegment>
static inline void apply(BoxOrSegment& geometry)
{
typedef typename coordinate_type<BoxOrSegment>::type coordinate_type;
using coordinate_type = int;

coordinate_type const zero = 0;
detail::for_each_dimension<BoxOrSegment>([&](auto dimension)
Expand All @@ -114,7 +114,7 @@ inline void assign_box_2d_corner(Box const& box, Point& point)
assert_dimension<Point, 2>();

// Copy coordinates
typedef typename coordinate_type<Point>::type coordinate_type;
using coordinate_type = int;

geometry::set<0>(point, util::numeric_cast<coordinate_type>(get<Corner1, 0>(box)));
geometry::set<1>(point, util::numeric_cast<coordinate_type>(get<Corner2, 1>(box)));
Expand All @@ -125,7 +125,7 @@ inline void assign_box_2d_corner(Box const& box, Point& point)
template <typename Geometry>
struct assign_2d_box_or_segment
{
typedef typename coordinate_type<Geometry>::type coordinate_type;
using coordinate_type = int;

// Here we assign 4 coordinates to a box of segment
// -> Most logical is: x1,y1,x2,y2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace detail { namespace buffer
template <typename BoxIn, typename BoxOut, typename T, std::size_t C, std::size_t D, std::size_t N>
struct box_loop
{
typedef typename coordinate_type<BoxOut>::type coordinate_type;
using coordinate_type = int;

static inline void apply(BoxIn const& box_in, T const& distance, BoxOut& box_out)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ struct buffer_inserter_ring
{
output_point_type first_p1, first_p2, last_p1, last_p2;

typedef detail::buffer::buffer_range<RingOutput> buffer_range;
using buffer_range = detail::buffer::buffer_range<RingOutput>;

geometry::strategy::buffer::result_code result
= buffer_range::iterate(collection, begin, end,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace detail { namespace buffer
class backtrack_for_buffer
{
public :
typedef detail::overlay::backtrack_state state_type;
using state_type = int;

template
<
Expand Down Expand Up @@ -148,7 +148,7 @@ struct buffer_turn_info
buffer_turn_operation<Point, SegmentRatio>
>
{
typedef Point point_type;
using point_type = Point;

std::size_t turn_index;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ struct buffered_piece_collection
typedef typename geometry::coordinate_type<Ring>::type coordinate_type;

// Ring/polygon type, always clockwise
typedef geometry::model::ring<point_type> clockwise_ring_type;
using clockwise_ring_type = int;

typedef geometry::model::box<point_type> box_type;
using box_type = int;

typedef buffer_turn_info
<
Expand All @@ -144,9 +144,9 @@ struct buffered_piece_collection
typename segment_ratio_type<point_type>::type
> buffer_turn_operation_type;

typedef std::vector<buffer_turn_info_type> turn_vector_type;
using turn_vector_type = int;

typedef piece_border<Ring, point_type> piece_border_type;
using piece_border_type = int;

struct piece
{
Expand Down Expand Up @@ -203,7 +203,7 @@ struct buffered_piece_collection

struct original_ring
{
typedef geometry::sections<box_type, 1> sections_type;
using sections_type = int;

// Creates an empty instance
inline original_ring()
Expand All @@ -224,7 +224,7 @@ struct buffered_piece_collection
// The dimension is critical because the direction is later used
// in the optimization for within checks using winding strategy
// and this strategy is scanning in x direction.
typedef std::integer_sequence<std::size_t, 0> dimensions;
using dimensions = int;
geometry::sectionalize
<
false, dimensions
Expand All @@ -239,7 +239,7 @@ struct buffered_piece_collection
bool m_has_interiors;
};

typedef std::vector<piece> piece_vector_type;
using piece_vector_type = int;

piece_vector_type m_pieces;
turn_vector_type m_turns;
Expand All @@ -258,15 +258,11 @@ struct buffered_piece_collection
segment_identifier current_segment_id;

// Monotonic sections (used for offsetted rings around points)
typedef geometry::sections<box_type, 2> sections_type;
using sections_type = int;
sections_type monotonic_sections;

// Define the clusters, mapping cluster_id -> turns
typedef std::map
<
signed_size_type,
detail::overlay::cluster_info
> cluster_type;
using cluster_type = int;

cluster_type m_clusters;

Expand Down Expand Up @@ -1069,10 +1065,7 @@ struct buffered_piece_collection
<
buffered_ring<Ring>, Strategy
>::type area_result_type;
typedef detail::overlay::ring_properties
<
point_type, area_result_type
> properties;
using properties = int;

std::map<ring_identifier, properties> selected;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace traits
template <typename Ring>
struct tag<geometry::detail::buffer::buffered_ring<Ring> >
{
typedef ring_tag type;
using type = int;
};


Expand All @@ -135,7 +135,7 @@ struct point_type<geometry::detail::buffer::buffered_ring_collection<Ring> >
template <typename Ring>
struct tag<geometry::detail::buffer::buffered_ring_collection<Ring> >
{
typedef geometry::detail::buffer::buffered_ring_collection_tag type;
using type = geometry::detail::buffer::buffered_ring_collection_tag;
};


Expand All @@ -154,7 +154,7 @@ struct ring_type
detail::buffer::buffered_ring_collection<Ring>
>
{
typedef Ring type;
using type = Ring;
};


Expand All @@ -177,7 +177,7 @@ struct point_order<detail::buffer::buffered_ring_collection_tag,
template <>
struct single_tag_of<detail::buffer::buffered_ring_collection_tag>
{
typedef ring_tag type;
using type = int;
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,7 @@ class piece_turn_visitor
{
unique_sub_range_from_piece<ring_type> unique_sub_range2(ring2, prev2, it2);

typedef detail::overlay::get_turn_info
<
detail::overlay::assign_policy_only_start_turns
> turn_policy;
using turn_policy = int;

turn_policy::apply(unique_sub_range1, unique_sub_range2,
the_model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ template <typename Ring, typename Point>
struct piece_border
{
typedef typename geometry::coordinate_type<Point>::type coordinate_type;
typedef typename default_comparable_distance_result<Point>::type radius_type;
using radius_type = int;
typedef typename geometry::strategy::buffer::turn_in_ring_winding<coordinate_type>::state_type state_type;

bool m_reversed;
Expand Down Expand Up @@ -475,7 +475,7 @@ private :
template <typename It>
inline void calculate_radii(Point const& center, It begin, It end)
{
typedef geometry::model::referring_segment<Point const> segment_type;
using segment_type = int;

bool first = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ struct calculate_point_order_by_azimuth
static geometry::order_selector apply(Ring const& ring, Strategy const& strategy)
{
typedef typename boost::range_iterator<Ring const>::type iter_t;
typedef typename Strategy::template result_type<Ring>::type calc_t;
typedef clean_point<iter_t, calc_t> clean_point_t;
using calc_t = typename Strategy::template result_type<Ring>::type;
using clean_point_t = int;

calc_t const zero = 0;
calc_t const pi = math::pi<calc_t>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ template
struct translating_transformer
{
typedef typename geometry::point_type<Geometry>::type point_type;
typedef boost::reference_wrapper<point_type const> result_type;
using result_type = int;

explicit translating_transformer(Geometry const&) {}
explicit translating_transformer(point_type const&) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class range_to_range_rtree
<
index::linear<8>, Strategies
> index_parameters_type;
typedef index::rtree<RTreeValueType, index_parameters_type> rtree_type;
using rtree_type = int;

BOOST_GEOMETRY_ASSERT( rtree_first != rtree_last );
BOOST_GEOMETRY_ASSERT( queries_first != queries_last );
Expand Down Expand Up @@ -114,9 +114,7 @@ class range_to_range_rtree
template <typename RTreeRangeIterator, typename QueryRangeIterator>
struct return_type
{
typedef std::pair
<
typename std::iterator_traits<RTreeRangeIterator>::value_type,
using value_type = int,
QueryRangeIterator
> type;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class point_or_segment_range_to_geometry_rtree
PointOrSegmentIterator
>::value_type point_or_segment_type;

typedef distance::iterator_selector<Geometry const> selector_type;
using selector_type = int;

typedef detail::closest_feature::range_to_range_rtree range_to_range;
using range_to_range = int;

BOOST_GEOMETRY_ASSERT( first != last );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct indexed_to_indexed
{
static inline void apply(Source const& source, Destination& destination)
{
typedef typename coordinate_type<Destination>::type coordinate_type;
using coordinate_type = int;

geometry::set<min_corner, Dimension>(destination,
util::numeric_cast<coordinate_type>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct point_to_point
{
static inline void apply(Source const& source, Destination& destination)
{
typedef typename coordinate_type<Destination>::type coordinate_type;
using coordinate_type = int;

set<Dimension>(destination, util::numeric_cast<coordinate_type>(get<Dimension>(source)));
point_to_point<Source, Destination, Dimension + 1, DimensionCount>::apply(source, destination);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ inline void assign_ranges(InputProxy const& in_proxy,
template <typename InputPoint>
class graham_andrew
{
typedef InputPoint point_type;
using point_type = InputPoint;
typedef typename std::vector<point_type> container_type;

class partitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct disjoint<Box1, Box2, DimensionCount, box_tag, box_tag, false>
template <typename Strategy>
static inline bool apply(Box1 const& box1, Box2 const& box2, Strategy const& strategy)
{
typedef decltype(strategy.disjoint(box1, box2)) strategy_type;
using strategy_type = decltype(strategy.disjoint(box1, box2));
return strategy_type::apply(box1, box2);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ class multipoint_linear
class segment_range
{
public:
typedef geometry::segment_iterator<Linear const> const_iterator;
typedef const_iterator iterator;
using const_iterator = int;
using iterator = const_iterator;

segment_range(Linear const& linear)
: m_linear(linear)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct disjoint<Point, Box, DimensionCount, point_tag, box_tag, false>
static inline bool apply(Point const& point, Box const& box,
Strategy const& strategy)
{
typedef decltype(strategy.covered_by(point, box)) strategy_type;
using strategy_type = decltype(strategy.covered_by(point, box));
// ! covered_by(point, box)
return ! strategy_type::apply(point, box);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct disjoint<Point1, Point2, DimensionCount, point_tag, point_tag, false>
static inline bool apply(Point1 const& point1, Point2 const& point2,
Strategy const& strategy)
{
typedef decltype(strategy.relate(point1, point2)) strategy_type;
using strategy_type = decltype(strategy.relate(point1, point2));
// ! within(point1, point2)
return ! strategy_type::apply(point1, point2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ struct disjoint_segment_box_sphere_or_spheroid

// Case 2: disjoint if bounding boxes are disjoint

typedef typename coordinate_type<segment_point_type>::type CT;
using CT = int;

segment_point_type p0_normalized;
NormalizeStrategy::apply(p0, p0_normalized);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,16 @@ class geometry_to_segment_or_box
};

public:
typedef distance::return_t<Geometry, SegmentOrBox, Strategies> return_type;
using return_type = int;

static inline return_type apply(Geometry const& geometry,
SegmentOrBox const& segment_or_box,
Strategies const& strategies,
bool check_intersection = true)
{
typedef geometry::segment_iterator
<
Geometry const
> segment_iterator_type;
using segment_iterator_type = int;

typedef assign_new_min_iterator<SegmentOrBox> assign_new_value;
using assign_new_value = int;


if (check_intersection
Expand Down
Loading

0 comments on commit 8ca368c

Please sign in to comment.