Skip to content

Commit e842950

Browse files
committed
[strategies] Use auto and const in some places in cartesian area strategies
1 parent 470e9e1 commit e842950

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

include/boost/geometry/strategies/area/cartesian.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct default_strategy<Geometry, cartesian_tag>
4747
template <typename CT>
4848
struct strategy_converter<strategy::area::cartesian<CT> >
4949
{
50-
static auto get(strategy::area::cartesian<CT> const& strategy)
50+
static auto get(strategy::area::cartesian<CT> const&)
5151
{
5252
return strategies::area::cartesian<CT>();
5353
}

include/boost/geometry/strategy/cartesian/area.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ public :
114114
}
115115

116116
template <typename Geometry>
117-
static inline typename result_type<Geometry>::type
118-
result(state<Geometry>& st)
117+
static inline auto result(state<Geometry>& st)
119118
{
120119
return st.area();
121120
}

include/boost/geometry/strategy/cartesian/precise_area.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,17 @@ public :
8989
{
9090
typedef typename state<Geometry>::return_type return_type;
9191

92-
auto det = (return_type(get<0>(p1)) + return_type(get<0>(p2)))
93-
* (return_type(get<1>(p1)) - return_type(get<1>(p2)));
92+
auto const det = (return_type(get<0>(p1)) + return_type(get<0>(p2)))
93+
* (return_type(get<1>(p1)) - return_type(get<1>(p2)));
9494

95-
auto res = boost::geometry::detail::precise_math::two_sum(st.sum1, det);
95+
auto const res = boost::geometry::detail::precise_math::two_sum(st.sum1, det);
9696

9797
st.sum1 = res[0];
9898
st.sum2 += res[1];
9999
}
100100

101101
template <typename Geometry>
102-
static inline typename result_type<Geometry>::type
103-
result(state<Geometry>& st)
102+
static inline auto result(state<Geometry>& st)
104103
{
105104
return st.area();
106105
}

0 commit comments

Comments
 (0)