Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78840 - trunk/boost/geometry/algorithms
From: bruno.lalande_at_[hidden]
Date: 2012-06-06 18:43:21


Author: bruno.lalande
Date: 2012-06-06 18:43:21 EDT (Wed, 06 Jun 2012)
New Revision: 78840
URL: http://svn.boost.org/trac/boost/changeset/78840

Log:
Made dispatch::overlaps able to retrieve the tags by itself.
Text files modified:
   trunk/boost/geometry/algorithms/overlaps.hpp | 30 +++++++++---------------------
   1 files changed, 9 insertions(+), 21 deletions(-)

Modified: trunk/boost/geometry/algorithms/overlaps.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/overlaps.hpp (original)
+++ trunk/boost/geometry/algorithms/overlaps.hpp 2012-06-06 18:43:21 EDT (Wed, 06 Jun 2012)
@@ -32,13 +32,12 @@
 
 template
 <
- typename Box1,
- typename Box2,
     std::size_t Dimension,
     std::size_t DimensionCount
>
 struct box_box_loop
 {
+ template <typename Box1, typename Box2>
     static inline void apply(Box1 const& b1, Box2 const& b2,
             bool& overlaps, bool& one_in_two, bool& two_in_one)
     {
@@ -84,8 +83,6 @@
 
         box_box_loop
             <
- Box1,
- Box2,
                 Dimension + 1,
                 DimensionCount
>::apply(b1, b2, overlaps, one_in_two, two_in_one);
@@ -94,24 +91,19 @@
 
 template
 <
- typename Box1,
- typename Box2,
     std::size_t DimensionCount
>
-struct box_box_loop<Box1, Box2, DimensionCount, DimensionCount>
+struct box_box_loop<DimensionCount, DimensionCount>
 {
+ template <typename Box1, typename Box2>
     static inline void apply(Box1 const& , Box2 const&, bool&, bool&, bool&)
     {
     }
 };
 
-template
-<
- typename Box1,
- typename Box2
->
 struct box_box
 {
+ template <typename Box1, typename Box2>
     static inline bool apply(Box1 const& b1, Box2 const& b2)
     {
         bool overlaps = true;
@@ -119,8 +111,6 @@
         bool within2 = true;
         box_box_loop
             <
- Box1,
- Box2,
                 0,
                 dimension<Box1>::type::value
>::apply(b1, b2, overlaps, within1, within2);
@@ -148,10 +138,10 @@
 
 template
 <
- typename Tag1,
- typename Tag2,
     typename Geometry1,
- typename Geometry2
+ typename Geometry2,
+ typename Tag1 = typename tag<Geometry1>::type,
+ typename Tag2 = typename tag<Geometry2>::type
>
 struct overlaps
 {
@@ -164,8 +154,8 @@
 
 
 template <typename Box1, typename Box2>
-struct overlaps<box_tag, box_tag, Box1, Box2>
- : detail::overlaps::box_box<Box1, Box2>
+struct overlaps<Box1, Box2, box_tag, box_tag>
+ : detail::overlaps::box_box
 {};
 
 
@@ -190,8 +180,6 @@
 
     return dispatch::overlaps
         <
- typename tag<Geometry1>::type,
- typename tag<Geometry2>::type,
             Geometry1,
             Geometry2
>::apply(geometry1, geometry2);


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