diff --git a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp index f2a329475..ac47412b0 100644 --- a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp +++ b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp @@ -152,46 +152,43 @@ struct get_direction_loop {} }; -template +//! Copy one static array to another +template struct copy_loop { - static inline void apply(T const source[DimensionCount], - T target[DimensionCount]) + static inline void apply(T const source[Count], T target[Count]) { - target[Dimension] = source[Dimension]; - copy_loop::apply(source, target); + target[Index] = source[Index]; + copy_loop::apply(source, target); } }; -template -struct copy_loop +template +struct copy_loop { - static inline void apply(T const [DimensionCount], T [DimensionCount]) + static inline void apply(T const [Count], T [Count]) {} }; -template +//! Compare two static arrays +template struct compare_loop { - static inline bool apply(T const source[DimensionCount], - T const target[DimensionCount]) + static inline bool apply(T const array1[Count], T const array2[Count]) { - bool const not_equal = target[Dimension] != source[Dimension]; - - return not_equal + return array1[Index] != array2[Index] ? false : compare_loop < - T, Dimension + 1, DimensionCount - >::apply(source, target); + T, Index + 1, Count + >::apply(array1, array2); } }; -template -struct compare_loop +template +struct compare_loop { - static inline bool apply(T const [DimensionCount], - T const [DimensionCount]) + static inline bool apply(T const [Count], T const [Count]) { return true; @@ -232,20 +229,21 @@ struct check_duplicate_loop } }; -template +//! Assign a value to a static array +template struct assign_loop { - static inline void apply(T dims[DimensionCount], int const value) + static inline void apply(T dims[Count], int const value) { - dims[Dimension] = value; - assign_loop::apply(dims, value); + dims[Index] = value; + assign_loop::apply(dims, value); } }; -template -struct assign_loop +template +struct assign_loop { - static inline void apply(T [DimensionCount], int const) + static inline void apply(T [Count], int const) { } };