Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84920 - trunk/boost/geometry/algorithms/detail
From: bruno.lalande_at_[hidden]
Date: 2013-06-30 17:01:03


Author: bruno.lalande
Date: 2013-06-30 17:01:02 EDT (Sun, 30 Jun 2013)
New Revision: 84920
URL: http://svn.boost.org/trac/boost/changeset/84920

Log:
Move some template parameters from class level to function level in assign_value.

Text files modified:
   trunk/boost/geometry/algorithms/detail/assign_values.hpp | 70 ++++++++++++++++-----------------------
   1 files changed, 29 insertions(+), 41 deletions(-)

Modified: trunk/boost/geometry/algorithms/detail/assign_values.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/assign_values.hpp Sun Jun 30 11:51:01 2013 (r84919)
+++ trunk/boost/geometry/algorithms/detail/assign_values.hpp 2013-06-30 17:01:02 EDT (Sun, 30 Jun 2013) (r84920)
@@ -46,36 +46,30 @@
 {
 
 
-template
-<
- typename Box, std::size_t Index,
- std::size_t Dimension, std::size_t DimensionCount
->
+template <std::size_t Index, std::size_t Dimension, std::size_t DimensionCount>
 struct initialize
 {
- typedef typename coordinate_type<Box>::type coordinate_type;
-
- static inline void apply(Box& box, coordinate_type const& value)
+ template <typename Box>
+ static inline void apply(Box& box, typename coordinate_type<Box>::type const& value)
     {
         geometry::set<Index, Dimension>(box, value);
- initialize<Box, Index, Dimension + 1, DimensionCount>::apply(box, value);
+ initialize<Index, Dimension + 1, DimensionCount>::apply(box, value);
     }
 };
 
 
-template <typename Box, std::size_t Index, std::size_t DimensionCount>
-struct initialize<Box, Index, DimensionCount, DimensionCount>
+template <std::size_t Index, std::size_t DimensionCount>
+struct initialize<Index, DimensionCount, DimensionCount>
 {
- typedef typename coordinate_type<Box>::type coordinate_type;
-
- static inline void apply(Box&, coordinate_type const& )
+ template <typename Box>
+ static inline void apply(Box&, typename coordinate_type<Box>::type const&)
     {}
 };
 
 
-template <typename Point>
 struct assign_zero_point
 {
+ template <typename Point>
     static inline void apply(Point& point)
     {
         geometry::assign_value(point, 0);
@@ -83,44 +77,38 @@
 };
 
 
-template <typename BoxOrSegment>
 struct assign_inverse_box_or_segment
 {
- typedef typename point_type<BoxOrSegment>::type point_type;
 
+ template <typename BoxOrSegment>
     static inline void apply(BoxOrSegment& geometry)
     {
+ typedef typename point_type<BoxOrSegment>::type point_type;
         typedef typename coordinate_type<point_type>::type bound_type;
 
- initialize
- <
- BoxOrSegment, 0, 0, dimension<BoxOrSegment>::type::value
- >::apply(
- geometry, boost::numeric::bounds<bound_type>::highest());
- initialize
- <
- BoxOrSegment, 1, 0, dimension<BoxOrSegment>::type::value
- >::apply(
- geometry, boost::numeric::bounds<bound_type>::lowest());
+ initialize<0, 0, dimension<BoxOrSegment>::type::value>::apply(
+ geometry, boost::numeric::bounds<bound_type>::highest()
+ );
+ initialize<1, 0, dimension<BoxOrSegment>::type::value>::apply(
+ geometry, boost::numeric::bounds<bound_type>::lowest()
+ );
     }
 };
 
 
-template <typename BoxOrSegment>
 struct assign_zero_box_or_segment
 {
+ template <typename BoxOrSegment>
     static inline void apply(BoxOrSegment& geometry)
     {
         typedef typename coordinate_type<BoxOrSegment>::type coordinate_type;
 
- initialize
- <
- BoxOrSegment, 0, 0, dimension<BoxOrSegment>::type::value
- >::apply(geometry, coordinate_type());
- initialize
- <
- BoxOrSegment, 1, 0, dimension<BoxOrSegment>::type::value
- >::apply(geometry, coordinate_type());
+ initialize<0, 0, dimension<BoxOrSegment>::type::value>::apply(
+ geometry, coordinate_type()
+ );
+ initialize<1, 0, dimension<BoxOrSegment>::type::value>::apply(
+ geometry, coordinate_type()
+ );
     }
 };
 
@@ -312,17 +300,17 @@
 
 template <typename Point>
 struct assign_zero<point_tag, Point>
- : detail::assign::assign_zero_point<Point>
+ : detail::assign::assign_zero_point
 {};
 
 template <typename Box>
 struct assign_zero<box_tag, Box>
- : detail::assign::assign_zero_box_or_segment<Box>
+ : detail::assign::assign_zero_box_or_segment
 {};
 
 template <typename Segment>
 struct assign_zero<segment_tag, Segment>
- : detail::assign::assign_zero_box_or_segment<Segment>
+ : detail::assign::assign_zero_box_or_segment
 {};
 
 
@@ -331,12 +319,12 @@
 
 template <typename Box>
 struct assign_inverse<box_tag, Box>
- : detail::assign::assign_inverse_box_or_segment<Box>
+ : detail::assign::assign_inverse_box_or_segment
 {};
 
 template <typename Segment>
 struct assign_inverse<segment_tag, Segment>
- : detail::assign::assign_inverse_box_or_segment<Segment>
+ : detail::assign::assign_inverse_box_or_segment
 {};
 
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk