11// Boost.Geometry (aka GGL, Generic Geometry Library)
22
33// Copyright (c) 2012-2020 Barend Gehrels, Amsterdam, the Netherlands.
4- // Copyright (c) 2022 Adam Wulkiewicz, Lodz, Poland.
4+ // Copyright (c) 2022-2023 Adam Wulkiewicz, Lodz, Poland.
55
66// This file was modified by Oracle on 2017-2022.
77// Modifications copyright (c) 2017-2022 Oracle and/or its affiliates.
4444#include < boost/geometry/strategies/buffer.hpp>
4545#include < boost/geometry/strategies/side.hpp>
4646
47- #include < boost/geometry/util/condition .hpp>
47+ #include < boost/geometry/util/constexpr .hpp>
4848#include < boost/geometry/util/math.hpp>
4949#include < boost/geometry/util/type_traits.hpp>
5050
@@ -942,17 +942,17 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
942942{
943943 boost::ignore_unused (visit_pieces_policy);
944944
945- typedef detail::buffer::buffered_piece_collection
946- <
947- typename geometry::ring_type<GeometryOutput>::type,
948- Strategies,
949- DistanceStrategy,
950- RobustPolicy
951- > collection_type ;
945+ using collection_type = detail::buffer::buffered_piece_collection
946+ <
947+ typename geometry::ring_type<GeometryOutput>::type,
948+ Strategies,
949+ DistanceStrategy,
950+ RobustPolicy
951+ > ;
952952 collection_type collection (strategies, distance_strategy, robust_policy);
953953 collection_type const & const_collection = collection;
954954
955- bool const areal = util::is_areal<GeometryInput>::value;
955+ static constexpr bool areal = util::is_areal<GeometryInput>::value;
956956
957957 dispatch::buffer_inserter
958958 <
@@ -969,7 +969,7 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
969969 robust_policy, strategies);
970970
971971 collection.get_turns ();
972- if ( BOOST_GEOMETRY_CONDITION ( areal) )
972+ if BOOST_GEOMETRY_CONSTEXPR ( areal)
973973 {
974974 collection.check_turn_in_original ();
975975 }
@@ -989,7 +989,7 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
989989 // phase 1: turns (after enrichment/clustering)
990990 visit_pieces_policy.apply (const_collection, 1 );
991991
992- if ( BOOST_GEOMETRY_CONDITION ( areal) )
992+ if BOOST_GEOMETRY_CONSTEXPR ( areal)
993993 {
994994 collection.deflate_check_turns ();
995995 }
@@ -1001,8 +1001,7 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
10011001 // - the output is counter clockwise
10021002 // and avoid reversing twice
10031003 bool reverse = distance_strategy.negative () && areal;
1004- if (BOOST_GEOMETRY_CONDITION (
1005- geometry::point_order<GeometryOutput>::value == counterclockwise))
1004+ if BOOST_GEOMETRY_CONSTEXPR (geometry::point_order<GeometryOutput>::value == counterclockwise)
10061005 {
10071006 reverse = ! reverse;
10081007 }
@@ -1011,9 +1010,12 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
10111010 collection.reverse ();
10121011 }
10131012
1014- if ( BOOST_GEOMETRY_CONDITION (distance_strategy. negative () && areal) )
1013+ if BOOST_GEOMETRY_CONSTEXPR ( areal)
10151014 {
1016- collection.discard_nonintersecting_deflated_rings ();
1015+ if (distance_strategy.negative ())
1016+ {
1017+ collection.discard_nonintersecting_deflated_rings ();
1018+ }
10171019 }
10181020
10191021 collection.template assign <GeometryOutput>(out);
0 commit comments