Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80245 - in trunk/boost/geometry: algorithms multi/algorithms
From: bruno.lalande_at_[hidden]
Date: 2012-08-26 19:33:15


Author: bruno.lalande
Date: 2012-08-26 19:33:14 EDT (Sun, 26 Aug 2012)
New Revision: 80245
URL: http://svn.boost.org/trac/boost/changeset/80245

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

Modified: trunk/boost/geometry/algorithms/unique.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/unique.hpp (original)
+++ trunk/boost/geometry/algorithms/unique.hpp 2012-08-26 19:33:14 EDT (Sun, 26 Aug 2012)
@@ -84,8 +84,8 @@
 
 template
 <
- typename Tag,
- typename Geometry
+ typename Geometry,
+ typename Tag = typename tag<Geometry>::type
>
 struct unique
 {
@@ -96,19 +96,19 @@
 
 
 template <typename Ring>
-struct unique<ring_tag, Ring>
+struct unique<Ring, ring_tag>
     : detail::unique::range_unique
 {};
 
 
 template <typename LineString>
-struct unique<linestring_tag, LineString>
+struct unique<LineString, linestring_tag>
     : detail::unique::range_unique
 {};
 
 
 template <typename Polygon>
-struct unique<polygon_tag, Polygon>
+struct unique<Polygon, polygon_tag>
     : detail::unique::polygon_unique
 {};
 
@@ -138,11 +138,7 @@
> policy;
 
 
- dispatch::unique
- <
- typename tag<Geometry>::type,
- Geometry
- >::apply(geometry, policy());
+ dispatch::unique<Geometry>::apply(geometry, policy());
 }
 
 }} // namespace boost::geometry

Modified: trunk/boost/geometry/multi/algorithms/unique.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/unique.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/unique.hpp 2012-08-26 19:33:14 EDT (Sun, 26 Aug 2012)
@@ -64,13 +64,13 @@
 
 
 template <typename MultiLineString>
-struct unique<multi_linestring_tag, MultiLineString>
+struct unique<MultiLineString, multi_linestring_tag>
     : detail::unique::multi_unique<detail::unique::range_unique>
 {};
 
 
 template <typename MultiPolygon>
-struct unique<multi_polygon_tag, MultiPolygon>
+struct unique<MultiPolygon, multi_polygon_tag>
     : detail::unique::multi_unique<detail::unique::polygon_unique>
 {};
 


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