Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76391 - in trunk/boost/geometry: algorithms multi/algorithms
From: bruno.lalande_at_[hidden]
Date: 2012-01-09 17:31:36


Author: bruno.lalande
Date: 2012-01-09 17:31:33 EST (Mon, 09 Jan 2012)
New Revision: 76391
URL: http://svn.boost.org/trac/boost/changeset/76391

Log:
Made dispatch::clear able to retrieve the tag by itself.
Text files modified:
   trunk/boost/geometry/algorithms/clear.hpp | 24 ++++++++++++------------
   trunk/boost/geometry/multi/algorithms/clear.hpp | 2 +-
   2 files changed, 13 insertions(+), 13 deletions(-)

Modified: trunk/boost/geometry/algorithms/clear.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/clear.hpp (original)
+++ trunk/boost/geometry/algorithms/clear.hpp 2012-01-09 17:31:33 EST (Mon, 09 Jan 2012)
@@ -79,7 +79,11 @@
 namespace dispatch
 {
 
-template <typename Tag, typename Geometry>
+template
+<
+ typename Geometry,
+ typename Tag = typename tag_cast<typename tag<Geometry>::type, multi_tag>::type
+>
 struct clear
 {
     BOOST_MPL_ASSERT_MSG
@@ -91,34 +95,34 @@
 
 // Point/box/segment do not have clear. So specialize to do nothing.
 template <typename Geometry>
-struct clear<point_tag, Geometry>
+struct clear<Geometry, point_tag>
     : detail::clear::no_action<Geometry>
 {};
 
 template <typename Geometry>
-struct clear<box_tag, Geometry>
+struct clear<Geometry, box_tag>
     : detail::clear::no_action<Geometry>
 {};
 
 template <typename Geometry>
-struct clear<segment_tag, Geometry>
+struct clear<Geometry, segment_tag>
     : detail::clear::no_action<Geometry>
 {};
 
 template <typename Geometry>
-struct clear<linestring_tag, Geometry>
+struct clear<Geometry, linestring_tag>
     : detail::clear::collection_clear<Geometry>
 {};
 
 template <typename Geometry>
-struct clear<ring_tag, Geometry>
+struct clear<Geometry, ring_tag>
     : detail::clear::collection_clear<Geometry>
 {};
 
 
 // Polygon can (indirectly) use std for clear
 template <typename Polygon>
-struct clear<polygon_tag, Polygon>
+struct clear<Polygon, polygon_tag>
     : detail::clear::polygon_clear<Polygon>
 {};
 
@@ -145,11 +149,7 @@
 {
     concept::check<Geometry>();
 
- dispatch::clear
- <
- typename tag_cast<typename tag<Geometry>::type, multi_tag>::type,
- Geometry
- >::apply(geometry);
+ dispatch::clear<Geometry>::apply(geometry);
 }
 
 

Modified: trunk/boost/geometry/multi/algorithms/clear.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/clear.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/clear.hpp 2012-01-09 17:31:33 EST (Mon, 09 Jan 2012)
@@ -28,7 +28,7 @@
 {
 
 template <typename Geometry>
-struct clear<multi_tag, Geometry>
+struct clear<Geometry, multi_tag>
     : detail::clear::collection_clear<Geometry>
 {};
 


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