|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r82469 - trunk/boost/geometry/algorithms
From: bruno.lalande_at_[hidden]
Date: 2013-01-12 16:06:45
Author: bruno.lalande
Date: 2013-01-12 16:06:44 EST (Sat, 12 Jan 2013)
New Revision: 82469
URL: http://svn.boost.org/trac/boost/changeset/82469
Log:
Reimplemented variants handling in clear algorithm.
Text files modified:
trunk/boost/geometry/algorithms/clear.hpp | 48 ++++++++++++++++++++++++---------------
1 files changed, 29 insertions(+), 19 deletions(-)
Modified: trunk/boost/geometry/algorithms/clear.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/clear.hpp (original)
+++ trunk/boost/geometry/algorithms/clear.hpp 2013-01-12 16:06:44 EST (Sat, 12 Jan 2013)
@@ -90,24 +90,6 @@
struct clear: not_implemented<Tag>
{};
-template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
-struct clear<variant<BOOST_VARIANT_ENUM_PARAMS(T)>, void>
-{
- struct visitor: static_visitor<void>
- {
- template <typename Geometry>
- inline void operator()(Geometry& geometry) const
- {
- clear<Geometry>::apply(geometry);
- }
- };
-
- static inline void apply(variant<BOOST_VARIANT_ENUM_PARAMS(T)>& geometry)
- {
- apply_visitor(visitor(), geometry);
- }
-};
-
// Point/box/segment do not have clear. So specialize to do nothing.
template <typename Geometry>
struct clear<Geometry, point_tag>
@@ -142,6 +124,34 @@
{};
+template <typename Geometry>
+struct devarianted_clear
+{
+ static inline void apply(Geometry& geometry)
+ {
+ clear<Geometry>::apply(geometry);
+ }
+};
+
+template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
+struct devarianted_clear<variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
+{
+ struct visitor: static_visitor<void>
+ {
+ template <typename Geometry>
+ inline void operator()(Geometry& geometry) const
+ {
+ clear<Geometry>::apply(geometry);
+ }
+ };
+
+ static inline void apply(variant<BOOST_VARIANT_ENUM_PARAMS(T)>& geometry)
+ {
+ apply_visitor(visitor(), geometry);
+ }
+};
+
+
} // namespace dispatch
#endif // DOXYGEN_NO_DISPATCH
@@ -164,7 +174,7 @@
{
concept::check<Geometry>();
- dispatch::clear<Geometry>::apply(geometry);
+ dispatch::devarianted_clear<Geometry>::apply(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