|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80244 - in trunk/boost/geometry: algorithms multi/algorithms
From: bruno.lalande_at_[hidden]
Date: 2012-08-26 19:08:37
Author: bruno.lalande
Date: 2012-08-26 19:08:36 EDT (Sun, 26 Aug 2012)
New Revision: 80244
URL: http://svn.boost.org/trac/boost/changeset/80244
Log:
Moved some template params from class to function level in dispatch::unique.
Text files modified:
trunk/boost/geometry/algorithms/unique.hpp | 34 ++++++++++++++++------------------
trunk/boost/geometry/multi/algorithms/unique.hpp | 33 ++++++++-------------------------
2 files changed, 24 insertions(+), 43 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:08:36 EDT (Sun, 26 Aug 2012)
@@ -34,9 +34,9 @@
{
-template <typename Range, typename ComparePolicy>
struct range_unique
{
+ template <typename Range, typename ComparePolicy>
static inline void apply(Range& range, ComparePolicy const& policy)
{
typename boost::range_iterator<Range>::type it
@@ -52,21 +52,20 @@
};
-template <typename Polygon, typename ComparePolicy>
struct polygon_unique
{
+ template <typename Polygon, typename ComparePolicy>
static inline void apply(Polygon& polygon, ComparePolicy const& policy)
{
typedef typename geometry::ring_type<Polygon>::type ring_type;
- typedef range_unique<ring_type, ComparePolicy> per_range;
- per_range::apply(exterior_ring(polygon), policy);
+ range_unique::apply(exterior_ring(polygon), policy);
typename interior_return_type<Polygon>::type rings
= interior_rings(polygon);
for (BOOST_AUTO_TPL(it, boost::begin(rings)); it != boost::end(rings); ++it)
{
- per_range::apply(*it, policy);
+ range_unique::apply(*it, policy);
}
}
};
@@ -86,31 +85,31 @@
template
<
typename Tag,
- typename Geometry,
- typename ComparePolicy
+ typename Geometry
>
struct unique
{
+ template <typename ComparePolicy>
static inline void apply(Geometry&, ComparePolicy const& )
{}
};
-template <typename Ring, typename ComparePolicy>
-struct unique<ring_tag, Ring, ComparePolicy>
- : detail::unique::range_unique<Ring, ComparePolicy>
+template <typename Ring>
+struct unique<ring_tag, Ring>
+ : detail::unique::range_unique
{};
-template <typename LineString, typename ComparePolicy>
-struct unique<linestring_tag, LineString, ComparePolicy>
- : detail::unique::range_unique<LineString, ComparePolicy>
+template <typename LineString>
+struct unique<linestring_tag, LineString>
+ : detail::unique::range_unique
{};
-template <typename Polygon, typename ComparePolicy>
-struct unique<polygon_tag, Polygon, ComparePolicy>
- : detail::unique::polygon_unique<Polygon, ComparePolicy>
+template <typename Polygon>
+struct unique<polygon_tag, Polygon>
+ : detail::unique::polygon_unique
{};
@@ -142,8 +141,7 @@
dispatch::unique
<
typename tag<Geometry>::type,
- Geometry,
- policy
+ Geometry
>::apply(geometry, policy());
}
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:08:36 EDT (Sun, 26 Aug 2012)
@@ -30,9 +30,10 @@
{
-template <typename MultiGeometry, typename ComparePolicy, typename Policy>
+template <typename Policy>
struct multi_unique
{
+ template <typename MultiGeometry, typename ComparePolicy>
static inline void apply(MultiGeometry& multi, ComparePolicy const& compare)
{
for (typename boost::range_iterator<MultiGeometry>::type
@@ -62,33 +63,15 @@
// possible for multi-points as well, removing points at the same location.
-template <typename MultiLineString, typename ComparePolicy>
-struct unique<multi_linestring_tag, MultiLineString, ComparePolicy>
- : detail::unique::multi_unique
- <
- MultiLineString,
- ComparePolicy,
- detail::unique::range_unique
- <
- typename boost::range_value<MultiLineString>::type,
- ComparePolicy
- >
- >
+template <typename MultiLineString>
+struct unique<multi_linestring_tag, MultiLineString>
+ : detail::unique::multi_unique<detail::unique::range_unique>
{};
-template <typename MultiPolygon, typename ComparePolicy>
-struct unique<multi_polygon_tag, MultiPolygon, ComparePolicy>
- : detail::unique::multi_unique
- <
- MultiPolygon,
- ComparePolicy,
- detail::unique::polygon_unique
- <
- typename boost::range_value<MultiPolygon>::type,
- ComparePolicy
- >
- >
+template <typename MultiPolygon>
+struct unique<multi_polygon_tag, MultiPolygon>
+ : 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