Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80160 - in trunk/boost/geometry: algorithms multi/algorithms
From: bruno.lalande_at_[hidden]
Date: 2012-08-23 15:57:34


Author: bruno.lalande
Date: 2012-08-23 15:57:34 EDT (Thu, 23 Aug 2012)
New Revision: 80160
URL: http://svn.boost.org/trac/boost/changeset/80160

Log:
Moved some template params from class to function level in transform helper metafunctions.
Text files modified:
   trunk/boost/geometry/algorithms/transform.hpp | 29 ++++++++++++-----------------
   trunk/boost/geometry/multi/algorithms/transform.hpp | 6 ++----
   2 files changed, 14 insertions(+), 21 deletions(-)

Modified: trunk/boost/geometry/algorithms/transform.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/transform.hpp (original)
+++ trunk/boost/geometry/algorithms/transform.hpp 2012-08-23 15:57:34 EDT (Thu, 23 Aug 2012)
@@ -41,9 +41,9 @@
 namespace detail { namespace transform
 {
 
-template <typename Point1, typename Point2, typename Strategy>
 struct transform_point
 {
+ template <typename Point1, typename Point2, typename Strategy>
     static inline bool apply(Point1 const& p1, Point2& p2,
                 Strategy const& strategy)
     {
@@ -52,9 +52,9 @@
 };
 
 
-template <typename Box1, typename Box2, typename Strategy>
 struct transform_box
 {
+ template <typename Box1, typename Box2, typename Strategy>
     static inline bool apply(Box1 const& b1, Box2& b2,
                 Strategy const& strategy)
     {
@@ -91,9 +91,9 @@
     }
 };
 
-template <typename Geometry1, typename Geometry2, typename Strategy>
 struct transform_box_or_segment
 {
+ template <typename Geometry1, typename Geometry2, typename Strategy>
     static inline bool apply(Geometry1 const& source, Geometry2& target,
                 Strategy const& strategy)
     {
@@ -133,12 +133,7 @@
         it != boost::end(range);
         ++it)
     {
- if (! transform_point
- <
- typename point_type<Range>::type,
- PointOut,
- Strategy
- >::apply(*it, point_out, strategy))
+ if (! transform_point::apply(*it, point_out, strategy))
         {
             return false;
         }
@@ -148,9 +143,9 @@
 }
 
 
-template <typename Polygon1, typename Polygon2, typename Strategy>
 struct transform_polygon
 {
+ template <typename Polygon1, typename Polygon2, typename Strategy>
     static inline bool apply(Polygon1 const& poly1, Polygon2& poly2,
                 Strategy const& strategy)
     {
@@ -211,9 +206,9 @@
>::type type;
 };
 
-template <typename Range1, typename Range2, typename Strategy>
 struct transform_range
 {
+ template <typename Range1, typename Range2, typename Strategy>
     static inline bool apply(Range1 const& range1,
             Range2& range2, Strategy const& strategy)
     {
@@ -244,7 +239,7 @@
 
 template <typename Point1, typename Point2, typename Strategy>
 struct transform<point_tag, point_tag, Point1, Point2, Strategy>
- : detail::transform::transform_point<Point1, Point2, Strategy>
+ : detail::transform::transform_point
 {
 };
 
@@ -255,31 +250,31 @@
         linestring_tag, linestring_tag,
         Linestring1, Linestring2, Strategy
>
- : detail::transform::transform_range<Linestring1, Linestring2, Strategy>
+ : detail::transform::transform_range
 {
 };
 
 template <typename Range1, typename Range2, typename Strategy>
 struct transform<ring_tag, ring_tag, Range1, Range2, Strategy>
- : detail::transform::transform_range<Range1, Range2, Strategy>
+ : detail::transform::transform_range
 {
 };
 
 template <typename Polygon1, typename Polygon2, typename Strategy>
 struct transform<polygon_tag, polygon_tag, Polygon1, Polygon2, Strategy>
- : detail::transform::transform_polygon<Polygon1, Polygon2, Strategy>
+ : detail::transform::transform_polygon
 {
 };
 
 template <typename Box1, typename Box2, typename Strategy>
 struct transform<box_tag, box_tag, Box1, Box2, Strategy>
- : detail::transform::transform_box<Box1, Box2, Strategy>
+ : detail::transform::transform_box
 {
 };
 
 template <typename Segment1, typename Segment2, typename Strategy>
 struct transform<segment_tag, segment_tag, Segment1, Segment2, Strategy>
- : detail::transform::transform_box_or_segment<Segment1, Segment2, Strategy>
+ : detail::transform::transform_box_or_segment
 {
 };
 

Modified: trunk/boost/geometry/multi/algorithms/transform.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/transform.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/transform.hpp 2012-08-23 15:57:34 EDT (Thu, 23 Aug 2012)
@@ -31,10 +31,10 @@
 /*!
     \brief Is able to transform any multi-geometry, calling the single-version as policy
 */
-template <typename Multi1, typename Multi2, typename Policy>
+template <typename Policy>
 struct transform_multi
 {
- template <typename S>
+ template <typename Multi1, typename Multi2, typename S>
     static inline bool apply(Multi1 const& multi1, Multi2& multi2, S const& strategy)
     {
         traits::resize<Multi2>::apply(multi2, boost::size(multi1));
@@ -74,8 +74,6 @@
>
     : detail::transform::transform_multi
         <
- Multi1,
- Multi2,
             transform
                 <
                     typename single_tag_of


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