|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67168 - in sandbox/geometry/boost/geometry: algorithms multi/algorithms multi/util util
From: barend.gehrels_at_[hidden]
Date: 2010-12-11 09:24:33
Author: barendgehrels
Date: 2010-12-11 09:24:31 EST (Sat, 11 Dec 2010)
New Revision: 67168
URL: http://svn.boost.org/trac/boost/changeset/67168
Log:
Removed (the need for) range_iterator_const_if_c using BOOST_AUTO
Removed:
sandbox/geometry/boost/geometry/util/range_iterator_const_if_c.hpp
Text files modified:
sandbox/geometry/boost/geometry/algorithms/for_each.hpp | 11 ++---------
sandbox/geometry/boost/geometry/multi/algorithms/for_each.hpp | 11 ++---------
sandbox/geometry/boost/geometry/multi/util/for_each_range.hpp | 7 ++-----
3 files changed, 6 insertions(+), 23 deletions(-)
Modified: sandbox/geometry/boost/geometry/algorithms/for_each.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/for_each.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/for_each.hpp 2010-12-11 09:24:31 EST (Sat, 11 Dec 2010)
@@ -24,7 +24,6 @@
#include <boost/geometry/geometries/segment.hpp>
#include <boost/geometry/util/add_const_if_c.hpp>
-#include <boost/geometry/util/range_iterator_const_if_c.hpp>
namespace boost { namespace geometry
@@ -77,20 +76,14 @@
typename add_const_if_c<IsConst, Range>::type& range,
Functor f)
{
- typedef typename range_iterator_const_if_c
- <
- IsConst,
- Range
- >::type iterator_type;
-
typedef typename add_const_if_c
<
IsConst,
typename point_type<Range>::type
>::type point_type;
- iterator_type it = boost::begin(range);
- iterator_type previous = it++;
+ BOOST_AUTO(it, boost::begin(range));
+ BOOST_AUTO(previous, it++);
while(it != boost::end(range))
{
model::referring_segment<point_type> s(*previous, *it);
Modified: sandbox/geometry/boost/geometry/multi/algorithms/for_each.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/algorithms/for_each.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/algorithms/for_each.hpp 2010-12-11 09:24:31 EST (Sat, 11 Dec 2010)
@@ -10,6 +10,7 @@
#include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
#include <boost/geometry/multi/core/tags.hpp>
#include <boost/geometry/multi/core/is_multi.hpp>
@@ -43,15 +44,7 @@
typename add_const_if_c<IsConst, MultiGeometry>::type& multi,
Functor f)
{
- typedef typename range_iterator_const_if_c
- <
- IsConst,
- MultiGeometry
- >::type iterator_type;
-
- for(iterator_type it = boost::begin(multi);
- it != boost::end(multi);
- ++it)
+ for(BOOST_AUTO(it, boost::begin(multi)); it != boost::end(multi); ++it)
{
f = Policy::apply(*it, f);
}
Modified: sandbox/geometry/boost/geometry/multi/util/for_each_range.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/util/for_each_range.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/util/for_each_range.hpp 2010-12-11 09:24:31 EST (Sat, 11 Dec 2010)
@@ -11,9 +11,9 @@
#include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
#include <boost/geometry/util/for_each_range.hpp>
-#include <boost/geometry/util/range_iterator_const_if_c.hpp>
#include <boost/geometry/multi/core/tags.hpp>
@@ -34,10 +34,7 @@
typename add_const_if_c<IsConst, Multi>::type& multi,
Actor& actor)
{
- for (typename range_iterator_const_if_c<IsConst, Multi>::type
- it = boost::begin(multi);
- it != boost::end(multi);
- ++it)
+ for(BOOST_AUTO(it, boost::begin(multi)); it != boost::end(multi); ++it)
{
geometry::for_each_range(*it, actor);
}
Deleted: sandbox/geometry/boost/geometry/util/range_iterator_const_if_c.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/util/range_iterator_const_if_c.hpp 2010-12-11 09:24:31 EST (Sat, 11 Dec 2010)
+++ (empty file)
@@ -1,44 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_UTIL_RANGE_ITERATOR_CONST_IF_C_HPP
-#define BOOST_GEOMETRY_UTIL_RANGE_ITERATOR_CONST_IF_C_HPP
-
-
-#include <boost/mpl/if.hpp>
-#include <boost/range.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-
-/*!
- \brief Meta-function to define a const or non const boost range iterator
- \ingroup utility
- \details Is used to have one implementation for both const and non const
- range iterators
- \note This traits class is completely independant from Boost.Geometry and
- might be a separate addition to Boost
- \note Used in for_each
-*/
-template <bool IsConst, typename Range>
-struct range_iterator_const_if_c
-{
- typedef typename boost::mpl::if_c
- <
- IsConst,
- typename boost::range_iterator<Range const>::type,
- typename boost::range_iterator<Range>::type
- >::type type;
-};
-
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_UTIL_RANGE_ITERATOR_CONST_IF_C_HPP
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