Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49048 - in sandbox/SOC/2006/tree/trunk/boost/tree: . detail detail/iterator
From: ockham_at_[hidden]
Date: 2008-09-29 17:45:50


Author: bernhard.reiter
Date: 2008-09-29 17:45:50 EDT (Mon, 29 Sep 2008)
New Revision: 49048
URL: http://svn.boost.org/trac/boost/changeset/49048

Log:
More cleanup.
Added:
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmented_iterator.hpp (contents, props changed)
Removed:
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/augmented.hpp
Text files modified:
   sandbox/SOC/2006/tree/trunk/boost/tree/balanced_tree.hpp | 2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/balanced_tree.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/balanced_tree.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/balanced_tree.hpp 2008-09-29 17:45:50 EDT (Mon, 29 Sep 2008)
@@ -20,7 +20,7 @@
 #include <boost/tree/detail/augmentors/unaugmented.hpp>
 
 #include <boost/tree/detail/algorithm/cursor/inorder.hpp>
-#include <boost/tree/detail/iterator/augmented.hpp>
+#include <boost/tree/detail/augmented_iterator.hpp>
 
 #include <boost/bind.hpp>
 #include <boost/multi_index/member.hpp>

Added: sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmented_iterator.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmented_iterator.hpp 2008-09-29 17:45:50 EDT (Mon, 29 Sep 2008)
@@ -0,0 +1,88 @@
+// Copyright (c) 2006-2008, Bernhard Reiter
+//
+// Distributed under 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)
+
+/**
+ * @file augmented_iterator.hpp
+ * Augmented iterator implementation
+ */
+
+
+#ifndef BOOST_TREE_DETAIL_AUGMENTED_ITERATOR_HPP
+#define BOOST_TREE_DETAIL_AUGMENTED_ITERATOR_HPP
+
+#include <boost/iterator/iterator_adaptor.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#include <boost/bind.hpp>
+#include <boost/multi_index/identity.hpp>
+
+#include <iterator>
+
+namespace boost {
+namespace tree {
+namespace detail {
+
+using boost::multi_index::identity;
+
+//TODO: Add extractor as 2nd ctor parameter?
+// Possibly use boost::transform_iterator?
+template <class InorderIter,
+ class Extract = identity<typename InorderIter::value_type>,
+ class Tag = typename std::iterator_traits<InorderIter>::iterator_category
+ >
+class augmented_iterator;
+
+template <class InorderIter, class Extract>
+class augmented_iterator<InorderIter, Extract, bidirectional_traversal_tag>
+ : public boost::iterator_adaptor<augmented_iterator<InorderIter, Extract, bidirectional_traversal_tag>
+ , InorderIter
+ , typename Extract::result_type //InorderIter::value_type::value_type
+ , bidirectional_traversal_tag
+ > {
+ private:
+ struct enabler {};
+ public:
+ augmented_iterator()
+ : augmented_iterator::iterator_adaptor_() {}
+
+ explicit augmented_iterator(InorderIter p)
+ : augmented_iterator::iterator_adaptor_(p) {}
+
+ explicit augmented_iterator(typename InorderIter::base_type c)
+ : augmented_iterator::iterator_adaptor_(InorderIter(c)) {}
+
+ template <class OtherInorderIter>
+ augmented_iterator(
+ augmented_iterator<OtherInorderIter> const& other
+ , typename boost::enable_if<
+ boost::is_convertible<OtherInorderIter,InorderIter>
+ , enabler
+ >::type = enabler()
+ )
+ : augmented_iterator::iterator_adaptor_(other.base()) {}
+
+ operator InorderIter()
+ {
+ return this->base();
+ }
+
+ private:
+ friend class boost::iterator_core_access;
+
+ typename augmented_iterator::iterator_adaptor_::reference
+ dereference() const
+ {
+ return Extract()(this->base());
+ }
+};
+
+
+} // namespace detail
+} // namespace tree
+} // namespace boost
+
+#endif // BOOST_TREE_DETAIL_AUGMENTED_ITERATOR_HPP

Deleted: sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/augmented.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/augmented.hpp 2008-09-29 17:45:50 EDT (Mon, 29 Sep 2008)
+++ (empty file)
@@ -1,88 +0,0 @@
-// Copyright (c) 2006-2008, Bernhard Reiter
-//
-// Distributed under 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)
-
-/**
- * @file augmented.hpp
- * Augmented iterator implementation
- */
-
-
-#ifndef BOOST_TREE_DETAIL_ITERATOR_AUGMENTED_HPP
-#define BOOST_TREE_DETAIL_ITERATOR_AUGMENTED_HPP
-
-#include <boost/iterator/iterator_adaptor.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-#include <boost/utility/enable_if.hpp>
-
-#include <boost/bind.hpp>
-#include <boost/multi_index/identity.hpp>
-
-#include <iterator>
-
-namespace boost {
-namespace tree {
-namespace detail {
-
-using boost::multi_index::identity;
-
-//TODO: Add extractor as 2nd ctor parameter?
-// Possibly use boost::transform_iterator?
-template <class InorderIter,
- class Extract = identity<typename InorderIter::value_type>,
- class Tag = typename std::iterator_traits<InorderIter>::iterator_category
- >
-class augmented_iterator;
-
-template <class InorderIter, class Extract>
-class augmented_iterator<InorderIter, Extract, bidirectional_traversal_tag>
- : public boost::iterator_adaptor<augmented_iterator<InorderIter, Extract, bidirectional_traversal_tag>
- , InorderIter
- , typename Extract::result_type //InorderIter::value_type::value_type
- , bidirectional_traversal_tag
- > {
- private:
- struct enabler {};
- public:
- augmented_iterator()
- : augmented_iterator::iterator_adaptor_() {}
-
- explicit augmented_iterator(InorderIter p)
- : augmented_iterator::iterator_adaptor_(p) {}
-
- explicit augmented_iterator(typename InorderIter::base_type c)
- : augmented_iterator::iterator_adaptor_(InorderIter(c)) {}
-
- template <class OtherInorderIter>
- augmented_iterator(
- augmented_iterator<OtherInorderIter> const& other
- , typename boost::enable_if<
- boost::is_convertible<OtherInorderIter,InorderIter>
- , enabler
- >::type = enabler()
- )
- : augmented_iterator::iterator_adaptor_(other.base()) {}
-
- operator InorderIter()
- {
- return this->base();
- }
-
- private:
- friend class boost::iterator_core_access;
-
- typename augmented_iterator::iterator_adaptor_::reference
- dereference() const
- {
- return Extract()(this->base());
- }
-};
-
-
-} // namespace detail
-} // namespace tree
-} // namespace boost
-
-#endif // BOOST_TREE_DETAIL_ITERATOR_AUGMENTED_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