Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48826 - in sandbox/SOC/2006/tree/trunk/boost/tree/detail: . algorithm/cursor algorithm/iterator augmentors balancers comparators cursor iterator node
From: ockham_at_[hidden]
Date: 2008-09-17 17:07:12


Author: bernhard.reiter
Date: 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
New Revision: 48826
URL: http://svn.boost.org/trac/boost/changeset/48826

Log:
Replace tabs by spaces.
Text files modified:
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/ascending.hpp | 22 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/general.hpp | 118 ++++++------
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/inorder.hpp | 350 +++++++++++++++++++-------------------
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/postorder.hpp | 278 +++++++++++++++---------------
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/preorder.hpp | 278 +++++++++++++++---------------
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/iterator/_order.hpp | 26 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/iterator/postorder.hpp | 2
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/iterator/preorder.hpp | 2
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/interval.hpp | 22 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/rank.hpp | 218 ++++++++++++------------
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/unaugmented.hpp | 32 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/red_black.hpp | 110 ++++++------
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/treap.hpp | 88 ++++----
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/unbalanced.hpp | 42 ++--
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/comparators/string.hpp | 24 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/forest.hpp | 102 +++++-----
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/multiway.hpp | 148 ++++++++--------
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/nary.hpp | 248 +++++++++++++-------------
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/_order.hpp | 22 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/ascending.hpp | 12
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/augmented.hpp | 28 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/postorder.hpp | 2
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/preorder.hpp | 2
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/node/nary.hpp | 356 ++++++++++++++++++++--------------------
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/node/traits.hpp | 34 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/range_helpers.hpp | 48 ++--
   26 files changed, 1309 insertions(+), 1305 deletions(-)

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/ascending.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/ascending.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/ascending.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -25,28 +25,28 @@
 /*\@{*/
 
 /**
- * @brief Ascending successor
- * @param c MultiwayCursor to be set to its ascending successor
- * @ingroup traversal
+ * @brief Ascending successor
+ * @param c MultiwayCursor to be set to its ascending successor
+ * @ingroup traversal
  */
 template <class MultiwayCursor>
 inline void forward(MultiwayCursor& c)
 {
- c.to_parent();
- return;
+ c.to_parent();
+ return;
 }
 
 /**
- * @brief Ascending successor
- * @param c A cursor
- * @return Ascending successor of @a c
- * @ingroup traversal
+ * @brief Ascending successor
+ * @param c A cursor
+ * @return Ascending successor of @a c
+ * @ingroup traversal
  */
 template <class MultiwayCursor>
 inline MultiwayCursor next(MultiwayCursor c)
 {
- forward(c);
- return c;
+ forward(c);
+ return c;
 }
 
 /*\@}*/

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/general.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/general.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/general.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -26,10 +26,10 @@
 
 // What about the subtree shapes?
 /**
- * @brief Checks two subtrees for element-wise equality.
- * @param c1 An input cursor.
- * @param c2 An input cursor.
- * @return A boolean true or false.
+ * @brief Checks two subtrees for element-wise equality.
+ * @param c1 An input cursor.
+ * @param c2 An input cursor.
+ * @return A boolean true or false.
  *
  * Compares the elements of two subtrees using @c ==. Returns true if
  * all the corresponding elements of the subtrees are equal; otherwise,
@@ -38,27 +38,27 @@
 template <class InCursor1, class InCursor2>
 bool equal(InCursor1 c1, InCursor2 c2)
 {
- InCursor1 d1 = c1.end();
- c1.to_begin();
- c2.to_begin();
- if (!(*c1 == *c2))
- return false;
- do {
- if (!c1.empty())
- if (!equal(c1, c2))
- return false;
- ++c2;
- } while (c1++ != d1);
-
- return true;
+ InCursor1 d1 = c1.end();
+ c1.to_begin();
+ c2.to_begin();
+ if (!(*c1 == *c2))
+ return false;
+ do {
+ if (!c1.empty())
+ if (!equal(c1, c2))
+ return false;
+ ++c2;
+ } while (c1++ != d1);
+
+ return true;
 }
 
 /**
- * @brief Checks two subtrees for element-wise equality.
- * @param c1 An input cursor.
- * @param c2 An input cursor.
- * @param p A binary predicate.
- * @return A boolean true or false.
+ * @brief Checks two subtrees for element-wise equality.
+ * @param c1 An input cursor.
+ * @param c2 An input cursor.
+ * @param p A binary predicate.
+ * @return A boolean true or false.
  *
  * Compares the elements of two subtrees using the p parameter.
  * Returns true if all the corresponding elements of the
@@ -67,58 +67,58 @@
 template <class InCursor1, class InCursor2, class BinPred>
 bool equal(InCursor1 c1, InCursor2 c2, BinPred p)
 {
- InCursor1 d1 = c1.end();
- c1.to_begin();
- c2.to_begin();
- if (!p(*c1,*c2))
- return false;
- do {
- if (!c1.empty())
- if (!equal(c1, c2))
- return false;
- ++c2;
- } while (c1++ != d1);
-
- return true;
+ InCursor1 d1 = c1.end();
+ c1.to_begin();
+ c2.to_begin();
+ if (!p(*c1,*c2))
+ return false;
+ do {
+ if (!c1.empty())
+ if (!equal(c1, c2))
+ return false;
+ ++c2;
+ } while (c1++ != d1);
+
+ return true;
 }
 
 /**
- * @brief Calculates the number of elements in a subtree.
- * @param c An input cursor.
- * @param s The size type of @c c1.
+ * @brief Calculates the number of elements in a subtree.
+ * @param c An input cursor.
+ * @param s The size type of @c c1.
  *
- * After finishing, s will have been increased by the number of elements in c.
+ * After finishing, s will have been increased by the number of elements in c.
  */
 template <class InCursor>
 void size(InCursor c, typename InCursor::size_type& s)
 {
- InCursor d = c.end();
- c.to_begin();
- ++s;
- do
- if (!c.empty())
- size(c, s);
- while (c++ != d);
+ InCursor d = c.end();
+ c.to_begin();
+ ++s;
+ do
+ if (!c.empty())
+ size(c, s);
+ while (c++ != d);
 }
 
 /**
- * @brief Returns the number of elements in a subtree.
- * @param c An input cursor.
- * @return The size type of @c c1.
+ * @brief Returns the number of elements in a subtree.
+ * @param c An input cursor.
+ * @return The size type of @c c1.
  */
 template <class InCursor>
 typename InCursor::size_type size(InCursor c)
 {
- typename InCursor::size_type s = 0;
- InCursor d = c.end();
- c.to_begin();
- ++s;
- do
- if (!c.empty())
- size(c, s);
- while (c++ != d);
-
- return s;
+ typename InCursor::size_type s = 0;
+ InCursor d = c.end();
+ c.to_begin();
+ ++s;
+ do
+ if (!c.empty())
+ size(c, s);
+ while (c++ != d);
+
+ return s;
 }
 
 

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/inorder.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/inorder.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/inorder.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -25,98 +25,98 @@
 /*\@{*/
 
 /**
- * @brief Inorder successor
- * @param c MultiwayCursor to be set to its inorder successor
- * @ingroup traversal
+ * @brief Inorder successor
+ * @param c MultiwayCursor to be set to its inorder successor
+ * @ingroup traversal
  */
 template <class MultiwayCursor>
 inline void forward(MultiwayCursor& c)
 {
- if (!(++c).empty()) {
- while (!c.to_begin().empty());
- return;
- }
-
- while (c.parity() && !c.is_root())
- c.to_parent();
- return;
+ if (!(++c).empty()) {
+ while (!c.to_begin().empty());
+ return;
+ }
+
+ while (c.parity() && !c.is_root())
+ c.to_parent();
+ return;
 }
 
 /**
- * @brief Inorder successor
- * @param c A cursor
- * @param n Optional parameter to indicate how many steps to move forward
- * @return Inorder successor of @a c
- * @ingroup traversal
+ * @brief Inorder successor
+ * @param c A cursor
+ * @param n Optional parameter to indicate how many steps to move forward
+ * @return Inorder successor of @a c
+ * @ingroup traversal
  */
 template <class MultiwayCursor>
 inline MultiwayCursor next(MultiwayCursor c
- , typename MultiwayCursor::difference_type n = 1)
+ , typename MultiwayCursor::difference_type n = 1)
 {
- for (; n!=0; --n)
- forward(c);
- return c;
+ for (; n!=0; --n)
+ forward(c);
+ return c;
 }
 
 /**
- * @brief Inorder predecessor
- * @param c MultiwayCursor to be set to its inorder predecessor
+ * @brief Inorder predecessor
+ * @param c MultiwayCursor to be set to its inorder predecessor
  */
 template <class MultiwayCursor>
 inline void back(MultiwayCursor& c)
 {
     if (!c.empty()) {
- while (!c.to_end().empty());
- --c;
- return;
- }
-
- while (!c.parity() && !c.is_root())
- c.to_parent();
- if (!c.is_root())
- --c;
- return;
+ while (!c.to_end().empty());
+ --c;
+ return;
+ }
+
+ while (!c.parity() && !c.is_root())
+ c.to_parent();
+ if (!c.is_root())
+ --c;
+ return;
 }
 
 /**
- * @brief Inorder predecessor
- * @param c MultiwayCursor
- * @param n Optional parameter to indicate how many steps to move back
- * @return Inorder predecessor of @a c
+ * @brief Inorder predecessor
+ * @param c MultiwayCursor
+ * @param n Optional parameter to indicate how many steps to move back
+ * @return Inorder predecessor of @a c
  */
 template <class MultiwayCursor>
 inline MultiwayCursor prior(MultiwayCursor c
- , typename MultiwayCursor::difference_type n = 1)
+ , typename MultiwayCursor::difference_type n = 1)
 {
- for (; n!=0; --n)
- back(c);
- return c;
+ for (; n!=0; --n)
+ back(c);
+ return c;
 }
 
 /**
- * @brief First element of a Multiway subtree in inorder traversal
- * @param c A MultiwayCursor
- * @return Cursor to the first element of @a c in inorder traversal
+ * @brief First element of a Multiway subtree in inorder traversal
+ * @param c A MultiwayCursor
+ * @return Cursor to the first element of @a c in inorder traversal
  */
 template <class MultiwayCursor>
 MultiwayCursor first(MultiwayCursor c)
 {
- while (!c.empty())
- c.to_begin();
- return c;
+ while (!c.empty())
+ c.to_begin();
+ return c;
 }
 
 /**
- * @brief One position past the last element of a Multiway subtree in
- * inorder traversal
- * @param c A MultiwayCursor
- * @return Cursor one position past the last element of @a c in inorder
- * traversal
+ * @brief One position past the last element of a Multiway subtree in
+ * inorder traversal
+ * @param c A MultiwayCursor
+ * @return Cursor one position past the last element of @a c in inorder
+ * traversal
  */
 template <class MultiwayCursor>
 MultiwayCursor last(MultiwayCursor c)
 {
- return c;
+ return c;
 }
 
 /*\@}*/
@@ -130,80 +130,82 @@
 template <class MultiwayCursor, class Op>
 void for_each_recursive(MultiwayCursor s, Op& f)
 {
- MultiwayCursor t = s.end();
+ MultiwayCursor t = s.end();
 
- for (s.to_begin(); s!=t; ++s) {
- if (!s.empty())
- for_each_recursive(s, f);
- f(*s);
- }
-
- // Multiway cursor
- if (!t.empty())
- for_each_recursive(t, f);
+ for (s.to_begin(); s!=t; ++s) {
+ if (!s.empty())
+ for_each_recursive(s, f);
+ f(*s);
+ }
+
+ // Multiway cursor
+ if (!t.empty())
+ for_each_recursive(t, f);
 }
 
 /**
- * @brief Apply a function to every element of a multiway subtree,
- * in inorder.
- * @param s A MultiwayTree cursor.
- * @param f A unary function object.
- * @return @p f
+ * @brief Apply a function to every element of a multiway subtree,
+ * in inorder.
+ * @param s A MultiwayTree cursor.
+ * @param f A unary function object.
+ * @return @p f
  *
  * Applies the function object @p f to each element in the @p subtree, using
  * inorder. @p f must not modify the order of the sequence.
  * If @p f has a return value it is ignored.
  */
+ //[ inorder_for_each
 template <class MultiwayCursor, class Op>
 Op for_each(MultiwayCursor s, Op f)
+//]
 {
- MultiwayCursor t = s.end();
+ MultiwayCursor t = s.end();
 
- for (s.to_begin(); s!=t; ++s) {
- if (!s.empty())
- for_each_recursive(s, f);
- f(*s);
- }
-
- // Multiway cursor
- if (!t.empty())
- for_each_recursive(t, f);
- return f;
+ for (s.to_begin(); s!=t; ++s) {
+ if (!s.empty())
+ for_each_recursive(s, f);
+ f(*s);
+ }
+
+ // Multiway cursor
+ if (!t.empty())
+ for_each_recursive(t, f);
+ return f;
 }
 
 /**
- * @brief Copies the subtree s into t, by traversing s in inorder.
- * @param s An input cursor.
+ * @brief Copies the subtree s into t, by traversing s in inorder.
+ * @param s An input cursor.
  * @param t An output cursor.
- * @result A cursor past t's inorder end, after the copying operation.
+ * @result A cursor past t's inorder end, after the copying operation.
  */
 template <class InCursor, class OutCursor>
 OutCursor copy (InCursor s, OutCursor t)
 {
- InCursor r = s.end();
+ InCursor r = s.end();
 
- s.to_begin();
- t.to_begin();
-
- for (; s != r; ++s, ++t) {
- if (!s.empty())
- copy(s, t);
- *t=*s;
- }
-
- // Multiway cursor
- if (!r.empty())
- copy(r, t);
- return t;
+ s.to_begin();
+ t.to_begin();
+
+ for (; s != r; ++s, ++t) {
+ if (!s.empty())
+ copy(s, t);
+ *t=*s;
+ }
+
+ // Multiway cursor
+ if (!r.empty())
+ copy(r, t);
+ return t;
 }
 
 /**
- * @brief Performs an operation on a subtree, by traversing it in inorder.
+ * @brief Performs an operation on a subtree, by traversing it in inorder.
  * @param s An input cursor.
  * @param t An output cursor.
  * @param op A unary operation.
- * @result A cursor past t's inorder end, after the transforming has
- * finished.
+ * @result A cursor past t's inorder end, after the transforming has
+ * finished.
  *
  * By traversing the input subtree s in inorder, apply the operation op
  * to each element and write the result to the output subtree t.
@@ -213,113 +215,113 @@
 template <class InCursor, class OutCursor, class Op>
 OutCursor transform (InCursor s, OutCursor t, Op op)
 {
- InCursor r = s.end();
+ InCursor r = s.end();
 
- s.to_begin();
- t.to_begin();
-
- for (; s != r; ++s, ++t) {
- if (!s.empty())
- transform(s, t, op);
- *t=op(*s);
- }
-
- // Multiway cursor
- if (!r.empty())
- transform(r, t, op);
- return t;
+ s.to_begin();
+ t.to_begin();
+
+ for (; s != r; ++s, ++t) {
+ if (!s.empty())
+ transform(s, t, op);
+ *t=op(*s);
+ }
+
+ // Multiway cursor
+ if (!r.empty())
+ transform(r, t, op);
+ return t;
 }
 
 /// Search
 
 /**
- * @brief Finds the first position in a multiway subtree in which @a val
- * could be inserted without changing the ordering, using < (less
- * than) for comparisons.
- * @param x The subtree's root
- * @param val The search term
- * @return A multiway cursor pointing to the first element not less than
- * @a val, or @x if every element in the subtree is less than
- * @a val.
+ * @brief Finds the first position in a multiway subtree in which @a val
+ * could be inserted without changing the ordering, using < (less
+ * than) for comparisons.
+ * @param x The subtree's root
+ * @param val The search term
+ * @return A multiway cursor pointing to the first element not less than
+ * @a val, or @x if every element in the subtree is less than
+ * @a val.
  */
 template <class MultiwayCursor, class T>
 MultiwayCursor lower_bound(MultiwayCursor x, T const& val)
 {
- MultiwayCursor y = x;
- while (!x.empty()) {
- x = std::lower_bound(x.begin(), x.end(), val);
- if (x.parity() == 0)
- y = x;
- }
- return y;
+ MultiwayCursor y = x;
+ while (!x.empty()) {
+ x = std::lower_bound(x.begin(), x.end(), val);
+ if (x.parity() == 0)
+ y = x;
+ }
+ return y;
 }
 
 /**
- * @brief Finds the first position in a multiway subtree in which @a val
- * could be inserted without changing the ordering, using @a cmp
- * for comparisons.
- * @param x The subtree's root
- * @param val The search term
- * @param cmp The comparison functor
- * @return A multiway cursor pointing to the first element not less than
- * @a val, or @x if every element in the subtree is less than
- * @a val.
+ * @brief Finds the first position in a multiway subtree in which @a val
+ * could be inserted without changing the ordering, using @a cmp
+ * for comparisons.
+ * @param x The subtree's root
+ * @param val The search term
+ * @param cmp The comparison functor
+ * @return A multiway cursor pointing to the first element not less than
+ * @a val, or @x if every element in the subtree is less than
+ * @a val.
  */
 template <class MultiwayCursor, class T, class Cmp>
 MultiwayCursor lower_bound(MultiwayCursor x, T const& val, Cmp cmp)
 {
- MultiwayCursor y = x;
- while (!x.empty()) {
- x = std::lower_bound(x.begin(), x.end(), val, cmp);
- if (x.parity() == 0)
- y = x;
- }
- return y;
+ MultiwayCursor y = x;
+ while (!x.empty()) {
+ x = std::lower_bound(x.begin(), x.end(), val, cmp);
+ if (x.parity() == 0)
+ y = x;
+ }
+ return y;
 }
 
 /**
- * @brief Finds the last position in a multiway subtree in which @a val
- * could be inserted without changing the ordering, using < (less
- * than) for comparisons.
- * @param x The subtree's root
- * @param val The search term
- * @return A multiway cursor pointing to the first element greater than
- * @a val, or @x if no element in the subtree is greater than
- * @a val.
+ * @brief Finds the last position in a multiway subtree in which @a val
+ * could be inserted without changing the ordering, using < (less
+ * than) for comparisons.
+ * @param x The subtree's root
+ * @param val The search term
+ * @return A multiway cursor pointing to the first element greater than
+ * @a val, or @x if no element in the subtree is greater than
+ * @a val.
  */
 template <class MultiwayCursor, class T>
 MultiwayCursor upper_bound(MultiwayCursor x, T const& val)
 {
- MultiwayCursor y = x;
- while (!x.empty()) {
- x = std::upper_bound(x.begin(), x.end(), val);
- if (x.parity() == 0)
- y = x;
- }
- return y;
+ MultiwayCursor y = x;
+ while (!x.empty()) {
+ x = std::upper_bound(x.begin(), x.end(), val);
+ if (x.parity() == 0)
+ y = x;
+ }
+ return y;
 }
 
 /**
- * @brief Finds the last position in a multiway subtree in which @a val
- * could be inserted without changing the ordering, using @a cmp
- * for comparisons.
- * @param x The subtree's root
- * @param val The search term
- * @param cmp The comparison functor
- * @return A multiway cursor pointing to the first element greater than
- * @a val, or @x if no element in the subtree is greater than
- * @a val.
+ * @brief Finds the last position in a multiway subtree in which @a val
+ * could be inserted without changing the ordering, using @a cmp
+ * for comparisons.
+ * @param x The subtree's root
+ * @param val The search term
+ * @param cmp The comparison functor
+ * @return A multiway cursor pointing to the first element greater than
+ * @a val, or @x if no element in the subtree is greater than
+ * @a val.
  */
 template <class MultiwayCursor, class T, class Cmp>
 MultiwayCursor upper_bound(MultiwayCursor x, T const& val, Cmp cmp)
 {
- MultiwayCursor y = x;
- while (!x.empty()) {
- x = std::upper_bound(x.begin(), x.end(), val, cmp);
- if (x.parity() == 0)
- y = x;
- }
- return y;
+ MultiwayCursor y = x;
+ while (!x.empty()) {
+ x = std::upper_bound(x.begin(), x.end(), val, cmp);
+ if (x.parity() == 0)
+ y = x;
+ }
+ return y;
 }
 
 // Implement equal_range? Maybe not, if it'd only return a pair

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/postorder.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/postorder.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/postorder.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -17,133 +17,133 @@
 
 namespace boost {
 namespace tree {
-
+
 namespace postorder {
 
 /** \addtogroup traversal */
 /*\@{*/
 
 /**
- * @brief Postorder successor
- * @param c Cursor to be set to its postorder successor
+ * @brief Postorder successor
+ * @param c Cursor to be set to its postorder successor
  */
 template <class Cursor>
 inline void forward(Cursor& c)
 {
- c.to_parent();
+ c.to_parent();
 
- if (c.is_root())
- return;
+ if (c.is_root())
+ return;
 
- if (c.parity()) { // Right child? Return parent.
- --c;
- return;
- }
-
- // Left child.
- ++c;
- while (!c.empty()) {
- c.to_begin();
- if (c.empty())
- ++c;
- }
- if (c.parity())
- --c;
- return;
+ if (c.parity()) { // Right child? Return parent.
+ --c;
+ return;
+ }
+
+ // Left child.
+ ++c;
+ while (!c.empty()) {
+ c.to_begin();
+ if (c.empty())
+ ++c;
+ }
+ if (c.parity())
+ --c;
+ return;
 }
 
 /**
- * @brief Postorder successor
- * @param c A cursor
- * @param n Optional parameter to indicate how many steps to move forward
- * @return Postorder successor of @a c
+ * @brief Postorder successor
+ * @param c A cursor
+ * @param n Optional parameter to indicate how many steps to move forward
+ * @return Postorder successor of @a c
  */
 template <class Cursor>
 inline Cursor next(Cursor c
- , typename Cursor::difference_type n = 1)
+ , typename Cursor::difference_type n = 1)
 {
- for (; n!=0; --n)
- forward(c);
- return c;
+ for (; n!=0; --n)
+ forward(c);
+ return c;
 }
 
 /**
- * @brief Postorder predecessor
- * @param c Cursor to be set to its postorder predecessor
+ * @brief Postorder predecessor
+ * @param c Cursor to be set to its postorder predecessor
  */
 template <class Cursor>
 inline void back(Cursor& c)
 {
- if (c.is_root()) { // Root?
- c.to_begin();
- return;
- }
-
- if (!(++c).empty()) { // Right
- c.to_begin();
- return;
- }
- if (!(--c).empty()) { // Left
- c.to_begin();
- return;
- }
-
- // Move up in the hierarchy until we find a descendant that has a right
- // child (which is what we'll return) or we land at root.
- while (!c.is_root()) {
- c.to_parent();
- if (c.parity())
- if (!(--c).empty()) {
- c.to_begin();
- return;
- }
- }
- return;
+ if (c.is_root()) { // Root?
+ c.to_begin();
+ return;
+ }
+
+ if (!(++c).empty()) { // Right
+ c.to_begin();
+ return;
+ }
+ if (!(--c).empty()) { // Left
+ c.to_begin();
+ return;
+ }
+
+ // Move up in the hierarchy until we find a descendant that has a right
+ // child (which is what we'll return) or we land at root.
+ while (!c.is_root()) {
+ c.to_parent();
+ if (c.parity())
+ if (!(--c).empty()) {
+ c.to_begin();
+ return;
+ }
+ }
+ return;
 }
 
 /**
- * @brief Postorder predecessor
- * @param c A cursor
- * @param n Optional parameter to indicate how many steps to move back
- * @return Postorder predecessor of @a c
+ * @brief Postorder predecessor
+ * @param c A cursor
+ * @param n Optional parameter to indicate how many steps to move back
+ * @return Postorder predecessor of @a c
  */
 template <class Cursor>
 inline Cursor prior(Cursor c
- , typename Cursor::difference_type n = 1)
+ , typename Cursor::difference_type n = 1)
 {
- for (; n!=0; --n)
- back(c);
- return c;
+ for (; n!=0; --n)
+ back(c);
+ return c;
 }
 
 /**
- * @brief First element of a subtree in postorder traversal
- * @param c A cursor
- * @return Cursor to the first element of @a c in postorder traversal
+ * @brief First element of a subtree in postorder traversal
+ * @param c A cursor
+ * @return Cursor to the first element of @a c in postorder traversal
  */
 template <class Cursor>
 Cursor first(Cursor c)
 {
- while (true)
- if (!c.empty())
- c.to_begin();
- else if (!(++c).empty())
- c.to_begin();
- else
- return --c;
+ while (true)
+ if (!c.empty())
+ c.to_begin();
+ else if (!(++c).empty())
+ c.to_begin();
+ else
+ return --c;
 }
 
 /**
- * @brief One position past the last element of a subtree in postorder
- * traversal
- * @param c A cursor
- * @return Cursor one position past the last element of @a c in
- * postorder traversal
+ * @brief One position past the last element of a subtree in postorder
+ * traversal
+ * @param c A cursor
+ * @return Cursor one position past the last element of @a c in
+ * postorder traversal
  */
 template <class Cursor>
 Cursor last(Cursor c)
 {
- return c;
+ return c;
 }
 
 /*\@}*/
@@ -157,23 +157,23 @@
 template <class Cursor, class Op>
 void for_each_recursive(Cursor s, Op& f)
 {
- Cursor t = s;
- for (s.to_begin(); s != t.end(); ++s)
- if (!s.empty())
- for_each_recursive(s, f);
+ Cursor t = s;
+ for (s.to_begin(); s != t.end(); ++s)
+ if (!s.empty())
+ for_each_recursive(s, f);
 
- // Multiway cursor
- if (!s.empty())
- for_each_recursive(s, f);
+ // Multiway cursor
+ if (!s.empty())
+ for_each_recursive(s, f);
 
- f(*t.to_begin());
+ f(*t.to_begin());
 }
 
 /**
- * @brief Apply a function to every element of a subtree, in postorder.
- * @param s A cursor.
- * @param f A unary function object.
- * @return @p f
+ * @brief Apply a function to every element of a subtree, in postorder.
+ * @param s A cursor.
+ * @param f A unary function object.
+ * @return @p f
  *
  * Applies the function object @p f to each element in the subtree @p s, using
  * postorder. @p f must not modify the order of the sequence.
@@ -182,57 +182,57 @@
 //[ postorder_for_each
 template <class Cursor, class Op>
 Op for_each(Cursor s, Op f)
+//]
 {
- Cursor t = s;
- for (s.to_begin(); s != t.end(); ++s)
- if (!s.empty())
- for_each_recursive(s, f);
-
- // Multiway cursor
- if (!s.empty())
- for_each_recursive(s, f);
+ Cursor t = s;
+ for (s.to_begin(); s != t.end(); ++s)
+ if (!s.empty())
+ for_each_recursive(s, f);
+
+ // Multiway cursor
+ if (!s.empty())
+ for_each_recursive(s, f);
 
- f(*t.to_begin());
+ f(*t.to_begin());
 
- return f;
+ return f;
 }
-//]
 
 /**
- * @brief Copies the subtree s into t, by traversing s in postorder.
- * @param s An input cursor.
+ * @brief Copies the subtree s into t, by traversing s in postorder.
+ * @param s An input cursor.
  * @param t An output cursor.
- * @result A cursor past t's postorder end, after the copying operation.
+ * @result A cursor past t's postorder end, after the copying operation.
  */
 template <class InCursor, class OutCursor>
 OutCursor copy (InCursor s, OutCursor t)
 {
- InCursor r = s;
- s.to_begin();
- t.to_begin();
-
- for (; s != r.end(); ++s, ++t) {
- if (!s.empty())
- copy(s, t);
-// else
-// *t = *s;
- }
-
- // Multiway cursor
- if (!s.empty())
- copy(s, t);
+ InCursor r = s;
+ s.to_begin();
+ t.to_begin();
+
+ for (; s != r.end(); ++s, ++t) {
+ if (!s.empty())
+ copy(s, t);
+// else
+// *t = *s;
+ }
+
+ // Multiway cursor
+ if (!s.empty())
+ copy(s, t);
 
- *t = *r.to_begin();
- return t;
+ *t = *r.to_begin();
+ return t;
 }
 
 /**
- * @brief Performs an operation on a subtree, by traversing it in postorder.
+ * @brief Performs an operation on a subtree, by traversing it in postorder.
  * @param s An input cursor.
  * @param t An output cursor.
  * @param op A unary operation.
- * @result A cursor past t's postorder end, after the transforming has
- * finished.
+ * @result A cursor past t's postorder end, after the transforming has
+ * finished.
  *
  * By traversing the input subtree s in postorder, apply the operation op
  * to each element and write the result to the output subtree t.
@@ -242,20 +242,20 @@
 template <class InCursor, class OutCursor, class Op>
 OutCursor transform (InCursor s, OutCursor t, Op op)
 {
- InCursor r = s;
- s.to_begin();
- t.to_begin();
-
- for (; s != r.end(); ++s, ++t)
- if (!s.empty())
- transform(s, t, op);
-
- // Multiway cursor
- if (!s.empty())
- transform(s, t, op);
-
- *t = op(*r.to_begin());
- return t;
+ InCursor r = s;
+ s.to_begin();
+ t.to_begin();
+
+ for (; s != r.end(); ++s, ++t)
+ if (!s.empty())
+ transform(s, t, op);
+
+ // Multiway cursor
+ if (!s.empty())
+ transform(s, t, op);
+
+ *t = op(*r.to_begin());
+ return t;
 }
 
 } // namespace postorder

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/preorder.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/preorder.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/preorder.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -17,130 +17,130 @@
 
 namespace boost {
 namespace tree {
-
+
 namespace preorder {
 
 /** \addtogroup traversal */
 /*\@{*/
 
 /**
- * @brief Preorder successor
- * @param c Cursor to be set to its preorder successor
+ * @brief Preorder successor
+ * @param c Cursor to be set to its preorder successor
  */
 template <class Cursor>
 inline void forward(Cursor& c)
 {
- // If we have a left child, go there.
- if (!c.empty()) {
- c.to_begin();
- return;
- }
-
- // No left child. So if we have a right child, go there.
- if (!(++c).empty()) {
- c.to_begin();
- return;
- }
-
- // (Here's where we'd need to check if this is the end().)
-
- // No children at all.
- // As we've already visited all the ancestors, we'll move upwards until
- // we find an ancestor that has a right child.
- while (!c.is_root()) { // Doesn't work with subtrees!
- c.to_parent();
- if (!c.is_root() && !c.parity()) {
- if (!(++c).empty()) {
- c.to_begin();
- return;
- }
- }
- }
- return;
+ // If we have a left child, go there.
+ if (!c.empty()) {
+ c.to_begin();
+ return;
+ }
+
+ // No left child. So if we have a right child, go there.
+ if (!(++c).empty()) {
+ c.to_begin();
+ return;
+ }
+
+ // (Here's where we'd need to check if this is the end().)
+
+ // No children at all.
+ // As we've already visited all the ancestors, we'll move upwards until
+ // we find an ancestor that has a right child.
+ while (!c.is_root()) { // Doesn't work with subtrees!
+ c.to_parent();
+ if (!c.is_root() && !c.parity()) {
+ if (!(++c).empty()) {
+ c.to_begin();
+ return;
+ }
+ }
+ }
+ return;
 }
 
 /**
- * @brief Preorder successor
- * @param c A cursor
- * @param n Optional parameter to indicate how many steps to move forward
- * @return Preorder successor of @a c
+ * @brief Preorder successor
+ * @param c A cursor
+ * @param n Optional parameter to indicate how many steps to move forward
+ * @return Preorder successor of @a c
  */
 template <class Cursor>
 inline Cursor next(Cursor c
- , typename Cursor::difference_type n = 1)
+ , typename Cursor::difference_type n = 1)
 {
- for (; n!=0; --n)
- forward(c);
- return c;
+ for (; n!=0; --n)
+ forward(c);
+ return c;
 }
 
 /**
- * @brief Preorder predecessor
- * @param c Cursor to be set to its preorder predecessor
+ * @brief Preorder predecessor
+ * @param c Cursor to be set to its preorder predecessor
  */
 template <class Cursor>
 inline void back(Cursor& c)
 {
- if (!c.is_root()) {
- c.to_parent();
-
- // If a left child was given, just move to its parent.
- if (!c.parity())
- return;
-
- // So this is a right child.
- --c;
- }
-
- // Same for root (=end) and right children:
- while (!c.empty())
- if (!c.end().empty())
- c.to_end();
- else
- c.to_begin();
-
- if (c.parity())
- --c;
- return;
+ if (!c.is_root()) {
+ c.to_parent();
+
+ // If a left child was given, just move to its parent.
+ if (!c.parity())
+ return;
+
+ // So this is a right child.
+ --c;
+ }
+
+ // Same for root (=end) and right children:
+ while (!c.empty())
+ if (!c.end().empty())
+ c.to_end();
+ else
+ c.to_begin();
+
+ if (c.parity())
+ --c;
+ return;
 }
 
 /**
- * @brief Preorder predecessor
- * @param c A cursor
- * @param n Optional parameter to indicate how many steps to move back
- * @return Preorder predecessor of @a c
+ * @brief Preorder predecessor
+ * @param c A cursor
+ * @param n Optional parameter to indicate how many steps to move back
+ * @return Preorder predecessor of @a c
  */
 template <class Cursor>
 inline Cursor prior(Cursor c
- , typename Cursor::difference_type n = 1)
+ , typename Cursor::difference_type n = 1)
 {
- for (; n!=0; --n)
- back(c);
- return c;
+ for (; n!=0; --n)
+ back(c);
+ return c;
 }
 
 /**
- * @brief First element of a subtree in preorder traversal
- * @param c A cursor
- * @return Cursor to the first element of @a c in preorder traversal
+ * @brief First element of a subtree in preorder traversal
+ * @param c A cursor
+ * @return Cursor to the first element of @a c in preorder traversal
  */
 template <class Cursor>
 Cursor first(Cursor c)
 {
- return c.begin();
+ return c.begin();
 }
 
 /**
- * @brief One position past the last element of a subtree in preorder
- * traversal
- * @param c A cursor
- * @return Cursor one position past the last element of @a c in preorder
- * traversal
+ * @brief One position past the last element of a subtree in preorder
+ * traversal
+ * @param c A cursor
+ * @return Cursor one position past the last element of @a c in preorder
+ * traversal
  */
 template <class Cursor>
 Cursor last(Cursor c)
 {
- return c;
+ return c;
 }
 
 /*\@}*/
@@ -154,78 +154,80 @@
 template <class Cursor, class Op>
 void for_each_recursive(Cursor s, Op& f)
 {
- Cursor t = s.end();
- for (s.to_begin(); s != t; ++s) {
- f(*s);
- if (!s.empty())
- for_each_recursive(s, f);
- }
-
- // Multiway cursor
- if (!s.empty())
- for_each_recursive(s, f);
+ Cursor t = s.end();
+ for (s.to_begin(); s != t; ++s) {
+ f(*s);
+ if (!s.empty())
+ for_each_recursive(s, f);
+ }
+
+ // Multiway cursor
+ if (!s.empty())
+ for_each_recursive(s, f);
 }
 
 /**
- * @brief Apply a function to every element of a subtree, in preorder.
- * @param s A cursor.
- * @param f A unary function object.
- * @return @p f
+ * @brief Apply a function to every element of a subtree, in preorder.
+ * @param s A cursor.
+ * @param f A unary function object.
+ * @return @p f
  *
  * Applies the function object @p f to each element in the @p subtree, using
  * preorder. @p f must not modify the order of the sequence.
  * If @p f has a return value it is ignored.
  */
+ //[ preorder_for_each
 template <class Cursor, class Op>
 Op for_each(Cursor s, Op f)
+//]
 {
- Cursor t = s.end();
- for (s.to_begin(); s != t; ++s) {
- f(*s);
- if (!s.empty())
- for_each_recursive(s, f);
- }
-
- // Multiway cursor
- if (!s.empty())
- for_each_recursive(s, f);
-
- return f;
+ Cursor t = s.end();
+ for (s.to_begin(); s != t; ++s) {
+ f(*s);
+ if (!s.empty())
+ for_each_recursive(s, f);
+ }
+
+ // Multiway cursor
+ if (!s.empty())
+ for_each_recursive(s, f);
+
+ return f;
 }
 
 /**
- * @brief Copies the subtree s into t, by traversing s in preorder.
- * @param s An input cursor.
+ * @brief Copies the subtree s into t, by traversing s in preorder.
+ * @param s An input cursor.
  * @param t An output cursor.
- * @result A cursor past t's preorder end, after the copying operation.
+ * @result A cursor past t's preorder end, after the copying operation.
  */
 template <class InCursor, class OutCursor>
 OutCursor copy (InCursor s, OutCursor t)
 {
- InCursor r = s.end();
- s.to_begin();
- t.to_begin();
-
- for (; s != r; ++s, ++t) {
- *t = *s;
- if (!s.empty())
- copy(s, t);
- }
+ InCursor r = s.end();
+ s.to_begin();
+ t.to_begin();
+
+ for (; s != r; ++s, ++t) {
+ *t = *s;
+ if (!s.empty())
+ copy(s, t);
+ }
 
- // Multiway cursor
- if (!r.empty())
- copy(r, t);
+ // Multiway cursor
+ if (!r.empty())
+ copy(r, t);
 
- return t;
+ return t;
 }
 
 /**
- * @brief Performs an operation on a subtree, by traversing it in preorder.
+ * @brief Performs an operation on a subtree, by traversing it in preorder.
  * @param s An input cursor.
  * @param t An output cursor.
  * @param op A unary operation.
- * @result A cursor past t's preorder end, after the transforming has
- * finished.
+ * @result A cursor past t's preorder end, after the transforming has
+ * finished.
  *
  * By traversing the input subtree s in preorder, apply the operation op
  * to each element and write the result to the output subtree t.
@@ -235,20 +237,20 @@
 template <class InCursor, class OutCursor, class Op>
 OutCursor transform (InCursor s, OutCursor t, Op op)
 {
- InCursor r = s.end();
- s.to_begin();
- t.to_begin();
- for (; s != r; ++s, ++t) {
- *t = op(*s);
- if (!s.empty())
- transform(s, t, op);
- }
-
- // Multiway cursor
- if (!s.empty())
- transform(s, t, op);
-
- return t;
+ InCursor r = s.end();
+ s.to_begin();
+ t.to_begin();
+ for (; s != r; ++s, ++t) {
+ *t = op(*s);
+ if (!s.empty())
+ transform(s, t, op);
+ }
+
+ // Multiway cursor
+ if (!s.empty())
+ transform(s, t, op);
+
+ return t;
 }
 
 } // namespace preorder

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/iterator/_order.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/iterator/_order.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/iterator/_order.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -4,7 +4,7 @@
 // (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-/** @file _order.hpp
+/** @file _order.hpp
  *
  * Some definitions that are identical for all *order cursors (as we are just
  * calling the appropriate traversal function that are defined in the
@@ -20,29 +20,29 @@
 // TODO: concept checks.
 
 /**
- * @brief First element of a subtree in traversal
- * (equivalent to postorder::begin())
- * @param c A cursor
- * @return Iterator to the first element of @a c
+ * @brief First element of a subtree in traversal
+ * (equivalent to postorder::begin())
+ * @param c A cursor
+ * @return Iterator to the first element of @a c
  */
 template <class Cursor>
 iterator<Cursor>
 begin(Cursor c)
 {
- return iterator<Cursor>(first(c));
+ return iterator<Cursor>(first(c));
 }
 
 /**
- * @brief One position past the last element of a subtree
- * in traversal (Alias of cend())
- * @param c A cursor
- * @return Iterator one position past the last element of @a c
+ * @brief One position past the last element of a subtree
+ * in traversal (Alias of cend())
+ * @param c A cursor
+ * @return Iterator one position past the last element of @a c
  */
 template <class Cursor>
 iterator<Cursor>
 end(Cursor c)
 {
- return iterator<Cursor>(last(c));
+ return iterator<Cursor>(last(c));
 }
 
 /// Reverse iterators
@@ -51,12 +51,12 @@
 std::reverse_iterator< iterator<Cursor> >
 rbegin(Cursor c)
 {
- return std::reverse_iterator< iterator<Cursor> >(end(c));
+ return std::reverse_iterator< iterator<Cursor> >(end(c));
 }
 
 template <class Cursor>
 std::reverse_iterator< iterator<Cursor> >
 rend(Cursor c)
 {
- return std::reverse_iterator< iterator<Cursor> >(begin(c));
+ return std::reverse_iterator< iterator<Cursor> >(begin(c));
 }

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/iterator/postorder.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/iterator/postorder.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/iterator/postorder.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -19,7 +19,7 @@
 
 namespace boost {
 namespace tree {
-
+
 namespace postorder {
 
 #include <boost/tree/detail/algorithm/iterator/_order.hpp>

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/iterator/preorder.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/iterator/preorder.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/iterator/preorder.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -19,7 +19,7 @@
 
 namespace boost {
 namespace tree {
-
+
 namespace preorder {
 
 #include <boost/tree/detail/algorithm/iterator/_order.hpp>

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/interval.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/interval.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/interval.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -22,11 +22,11 @@
 //TODO: concept checks...
 //use boost bind or lambda instead!!!
 template<typename T, class Interval = std::pair<T,T>,
- class ExtractLeft = &std::pair<T,T>::first,
- class ExtractRight = &std::pair<T,T>::second,
- class Left = member<Interval,T,ExtractLeft>,
- class Right = member<Interval,T,ExtractRight>
- >
+ class ExtractLeft = &std::pair<T,T>::first,
+ class ExtractRight = &std::pair<T,T>::second,
+ class Left = member<Interval,T,ExtractLeft>,
+ class Right = member<Interval,T,ExtractRight>
+ >
 struct interval_extract : public composite_key<Interval, Left, Right> {};
 
 
@@ -34,19 +34,19 @@
 struct interval_search
 {
  public:
- typedef T value_type;
- value_type const& largest_endpoint() { return m_largest_endpoint; }
+ typedef T value_type;
+ value_type const& largest_endpoint() { return m_largest_endpoint; }
  protected:
- //update etc.
+ //update etc.
  private:
- value_type m_largest_endpoint;
+ value_type m_largest_endpoint;
 };
 
 template <class Cursor>
 bool overlaps(Cursor c, typename Cursor::value_type val)
 {
- //FIXME: implement.
- return true;
+ //FIXME: implement.
+ return true;
 }
 
 } // namespace augmentors

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/rank.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/rank.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/rank.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -10,95 +10,95 @@
 namespace boost {
 namespace tree {
 namespace augmentors {
-
+
 //TODO: lots. current implementation is dysfunctional.
 
 template <typename SizeType>
 class rank_data {
  public:
- typedef SizeType size_type;
- //get_rank - just show rank info
-
-// size_type const get_rank() const
-// {
-// return m_rank;
-// }
-//
-// void set_rank(size_type priority)
-// {
-// m_rank = rank;
-// }
-
- rank_data(size_type r = 1)
- : m_rank(r) {}
-
- size_type& rank()
- {
- return m_rank;
- }
-
- size_type const& rank() const
- {
- return m_rank;
- }
-
- //operator[] ? rather not...
-
-
+ typedef SizeType size_type;
+ //get_rank - just show rank info
+
+// size_type const get_rank() const
+// {
+// return m_rank;
+// }
+//
+// void set_rank(size_type priority)
+// {
+// m_rank = rank;
+// }
+
+ rank_data(size_type r = 1)
+ : m_rank(r) {}
+
+ size_type& rank()
+ {
+ return m_rank;
+ }
+
+ size_type const& rank() const
+ {
+ return m_rank;
+ }
+
+ //operator[] ? rather not...
+
+
 private:
- size_type m_rank;
+ size_type m_rank;
 };
 
 template <typename SizeType = std::size_t>
 class rank {
  public:
- typedef SizeType size_type;
- typedef rank_data<size_type> metadata_type;
-
+ typedef SizeType size_type;
+ typedef rank_data<size_type> metadata_type;
+
  protected:
- //or metadata as param-type?
- template <class Tree>
- void pre_rotate(Tree&, typename Tree::cursor& q)
- {
- typename Tree::cursor p = q->parent();
- if (!q.parity())
- p.metadata().rank() -= q.metadata().rank();
- else
- q.metadata().rank() += p.metadata().rank();
- }
-
- template <class Tree>
- void pre_detach(Tree& t, typename Tree::cursor& y)
- {
- typename Tree::cursor p = y;
- while (p.parent() != t.root()) {
- if (!p.parity())
- --p.parent().metadata().rank();
- p = p.parent();
- }
- }
-
- template <class Tree>
- void pre_detach(Tree& t, typename Tree::cursor& y, typename Tree::cursor& z)
- {
- typename Tree::cursor p = y;
- while (p.parent() != t.root()) {
- if (!p.parity())
- --p.parent().metadata().rank();
- p = p.parent();
- }
- if (z == t.root())
- y.metadata().rank() = z.metadata().rank();
- }
-
- template <class Tree>
- void descend(Tree&, typename Tree::cursor& p)
- {
- if (p.parity() == 0) {
- ++p.metadata().rank();
- }
- }
-
+ //or metadata as param-type?
+ template <class Tree>
+ void pre_rotate(Tree&, typename Tree::cursor& q)
+ {
+ typename Tree::cursor p = q->parent();
+ if (!q.parity())
+ p.metadata().rank() -= q.metadata().rank();
+ else
+ q.metadata().rank() += p.metadata().rank();
+ }
+
+ template <class Tree>
+ void pre_detach(Tree& t, typename Tree::cursor& y)
+ {
+ typename Tree::cursor p = y;
+ while (p.parent() != t.root()) {
+ if (!p.parity())
+ --p.parent().metadata().rank();
+ p = p.parent();
+ }
+ }
+
+ template <class Tree>
+ void pre_detach(Tree& t, typename Tree::cursor& y, typename Tree::cursor& z)
+ {
+ typename Tree::cursor p = y;
+ while (p.parent() != t.root()) {
+ if (!p.parity())
+ --p.parent().metadata().rank();
+ p = p.parent();
+ }
+ if (z == t.root())
+ y.metadata().rank() = z.metadata().rank();
+ }
+
+ template <class Tree>
+ void descend(Tree&, typename Tree::cursor& p)
+ {
+ if (p.parity() == 0) {
+ ++p.metadata().rank();
+ }
+ }
+
 };
 
 } // namespace augmentors
@@ -107,43 +107,43 @@
 template <class Tree>
 typename Tree::const_cursor select_rank(Tree const& tree, typename Tree::augmentor_type::size_type i)
 {
- typename Tree::const_cursor p = tree.root().begin();
- if (p.metadata().rank() < i) {
- return p;
- }
- ++i;
- p = p.begin();
- for (;;) {
- if (i < p.metadata().rank())
- p = p.begin();
- else {
- i -= p.metadata().rank();
- if (i == 0)
- return p;
- p = p.end();
- }
- }
+ typename Tree::const_cursor p = tree.root().begin();
+ if (p.metadata().rank() < i) {
+ return p;
+ }
+ ++i;
+ p = p.begin();
+ for (;;) {
+ if (i < p.metadata().rank())
+ p = p.begin();
+ else {
+ i -= p.metadata().rank();
+ if (i == 0)
+ return p;
+ p = p.end();
+ }
+ }
 }
 
 template <class Tree>
 typename Tree::cursor select_rank(Tree& tree, typename Tree::augmentor_type::size_type i)
 {
- typename Tree::cursor p = tree.root().begin();
- if (p.metadata().rank() < i) {
- return p;
- }
- ++i;
- p = p.begin();
- for (;;) {
- if (i < p.metadata().rank())
- p = p.begin();
- else {
- i -= p.metadata().rank();
- if (i == 0)
- return p;
- p = p.end();
- }
- }
+ typename Tree::cursor p = tree.root().begin();
+ if (p.metadata().rank() < i) {
+ return p;
+ }
+ ++i;
+ p = p.begin();
+ for (;;) {
+ if (i < p.metadata().rank())
+ p = p.begin();
+ else {
+ i -= p.metadata().rank();
+ if (i == 0)
+ return p;
+ p = p.end();
+ }
+ }
 }
 
 } // namespace tree

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/unaugmented.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/unaugmented.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/augmentors/unaugmented.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -21,23 +21,23 @@
  */
 class unaugmented {
  public:
- struct metadata_type {};
+ struct metadata_type {};
  protected:
- template <class Tree>
- void pre_rotate(Tree&, typename Tree::cursor&)
- { }
-
- template <class Tree>
- void pre_detach(Tree&, typename Tree::cursor&)
- { }
-
- template <class Tree>
- void pre_detach(Tree&, typename Tree::cursor&, typename Tree::cursor&)
- { }
-
- template <class Tree>
- void descend(Tree&, typename Tree::cursor&)
- { }
+ template <class Tree>
+ void pre_rotate(Tree&, typename Tree::cursor&)
+ { }
+
+ template <class Tree>
+ void pre_detach(Tree&, typename Tree::cursor&)
+ { }
+
+ template <class Tree>
+ void pre_detach(Tree&, typename Tree::cursor&, typename Tree::cursor&)
+ { }
+
+ template <class Tree>
+ void descend(Tree&, typename Tree::cursor&)
+ { }
 };
 
 } // namespace augmentors

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/red_black.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/red_black.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/red_black.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -16,70 +16,70 @@
 namespace boost {
 namespace tree {
 namespace balancers {
-
+
 enum red_black_color { black, red };
 
 class red_black_metadata {
-public:
- red_black_metadata()
- : m_color(black) {}
-
- red_black_color get_color()
- {
- return m_color;
- }
-
- void set_color(red_black_color col)
- {
- m_color = col;
- }
+public:
+ red_black_metadata()
+ : m_color(black) {}
+
+ red_black_color get_color()
+ {
+ return m_color;
+ }
+
+ void set_color(red_black_color col)
+ {
+ m_color = col;
+ }
 private:
- red_black_color m_color;
+ red_black_color m_color;
 
 };
 
 class red_black {
 public:
- typedef red_black_metadata metadata_type;
-
- template <class Tree>
- static void add(Tree& t, typename Tree::cursor& x)
- {
- x->metadata().set_color(red);
- while (x.parent()->metadata().get_color() == red) {
- typename Tree::cursor y = x.parent();
- y = (y == y.parent().begin() ? y.parent().end() : y.parent().begin());
- if (y->metadata().get_color() == red) {
- x.parent()->metadata().set_color(black);
- x.parent().parent()->metadata().set_color(red);
- y->metadata().set_color(black);
- x = x.parent().parent();
- } else {
- if (x.parity() != x.parent().parity()) {
- t.rotate(x);
- x = (x.parity() ? x.end() : x.begin());
- }
- x.parent()->metadata().set_color(black);
- x.parent().parent()->metadata().set_color(red);
- x = x.parent(); //FIXME: was x.parent.rotate();
- t.rotate(x);
- }
- if (x.parent() == t.root())
- x->metadata().set_color(black);
- }
- }
-
- // second argument also used to pass second parameter for detach,
- // if required.
- template <class Tree>
- static void remove(Tree& t, typename Tree::cursor& x)
- {
-
- }
-
- template <class Tree>
- static void touch(Tree& t, typename Tree::cursor&)
- { }
+ typedef red_black_metadata metadata_type;
+
+ template <class Tree>
+ static void add(Tree& t, typename Tree::cursor& x)
+ {
+ x->metadata().set_color(red);
+ while (x.parent()->metadata().get_color() == red) {
+ typename Tree::cursor y = x.parent();
+ y = (y == y.parent().begin() ? y.parent().end() : y.parent().begin());
+ if (y->metadata().get_color() == red) {
+ x.parent()->metadata().set_color(black);
+ x.parent().parent()->metadata().set_color(red);
+ y->metadata().set_color(black);
+ x = x.parent().parent();
+ } else {
+ if (x.parity() != x.parent().parity()) {
+ t.rotate(x);
+ x = (x.parity() ? x.end() : x.begin());
+ }
+ x.parent()->metadata().set_color(black);
+ x.parent().parent()->metadata().set_color(red);
+ x = x.parent(); //FIXME: was x.parent.rotate();
+ t.rotate(x);
+ }
+ if (x.parent() == t.root())
+ x->metadata().set_color(black);
+ }
+ }
+
+ // second argument also used to pass second parameter for detach,
+ // if required.
+ template <class Tree>
+ static void remove(Tree& t, typename Tree::cursor& x)
+ {
+
+ }
+
+ template <class Tree>
+ static void touch(Tree& t, typename Tree::cursor&)
+ { }
   
 };
 

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/treap.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/treap.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/treap.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -23,56 +23,56 @@
 namespace balancers {
 
 class treap_metadata {
-public:
- treap_metadata()
- : m_priority((lrand48() >> 1) + 1) {}
-
- int const get_priority() const
- {
- return m_priority;
- }
-
- void set_priority(int priority)
- {
- m_priority = priority;
- }
+public:
+ treap_metadata()
+ : m_priority((lrand48() >> 1) + 1) {}
+
+ int const get_priority() const
+ {
+ return m_priority;
+ }
+
+ void set_priority(int priority)
+ {
+ m_priority = priority;
+ }
 private:
- int m_priority;
+ int m_priority;
 };
 
 
 class treap {
  public:
- typedef treap_metadata metadata_type;
-
- template <class Tree>
- static void add(Tree& t, typename Tree::cursor& x)
- {
- int priority = x->metadata().get_priority();
-
- x = x.parent();
- while ((x != t.root()) && (priority > x->metadata().get_priority())) {
- t.rotate(x);
- priority = x->metadata().get_priority();
- }
- x = x.begin();
- }
-
- template <class Tree>
- static typename Tree::cursor remove(Tree& t, typename Tree::cursor& p)
- {
- typename Tree::cursor q;
- while((q = ((p.begin()->metadata().get_priority()
- > p.end()->metadata().get_priority())
- ? p.begin() : p.end())).empty())
- t.rotate(q);
- p = q;
- return p;
- }
-
- template <class Tree>
- static void touch(Tree&, typename Tree::cursor&)
- { }
+ typedef treap_metadata metadata_type;
+
+ template <class Tree>
+ static void add(Tree& t, typename Tree::cursor& x)
+ {
+ int priority = x->metadata().get_priority();
+
+ x = x.parent();
+ while ((x != t.root()) && (priority > x->metadata().get_priority())) {
+ t.rotate(x);
+ priority = x->metadata().get_priority();
+ }
+ x = x.begin();
+ }
+
+ template <class Tree>
+ static typename Tree::cursor remove(Tree& t, typename Tree::cursor& p)
+ {
+ typename Tree::cursor q;
+ while((q = ((p.begin()->metadata().get_priority()
+ > p.end()->metadata().get_priority())
+ ? p.begin() : p.end())).empty())
+ t.rotate(q);
+ p = q;
+ return p;
+ }
+
+ template <class Tree>
+ static void touch(Tree&, typename Tree::cursor&)
+ { }
 };
 
 } // namespace balancers

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/unbalanced.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/unbalanced.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/balancers/unbalanced.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -16,29 +16,29 @@
 
 class unbalanced {
  public:
- unbalanced() {}
+ unbalanced() {}
 
- struct metadata_type {};
- //metadata_type metadata;
+ struct metadata_type {};
+ //metadata_type metadata;
 
-// protected:
- template <class Tree>
- static void add(Tree&, typename Tree::cursor& c)
- { }
-
- template <class Tree>
- static typename Tree::cursor remove(Tree& t, typename Tree::cursor& x)
- {
- //typename Tree::cursor y = x;
- if (x.begin().empty() || x.end().empty())
- return x;
- //inorder::forward(x);
- return inorder::next(x);
- }
-
- template <class Tree>
- static void touch(Tree&, typename Tree::cursor&)
- { }
+// protected:
+ template <class Tree>
+ static void add(Tree&, typename Tree::cursor& c)
+ { }
+
+ template <class Tree>
+ static typename Tree::cursor remove(Tree& t, typename Tree::cursor& x)
+ {
+ //typename Tree::cursor y = x;
+ if (x.begin().empty() || x.end().empty())
+ return x;
+ //inorder::forward(x);
+ return inorder::next(x);
+ }
+
+ template <class Tree>
+ static void touch(Tree&, typename Tree::cursor&)
+ { }
 };
 
 } // namespace balancers

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/comparators/string.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/comparators/string.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/comparators/string.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -23,19 +23,19 @@
 template <class Cntnr1, class Cntnr2>
 class container_lexicographical_compare : public std::binary_function<Cntnr1, Cntnr2, bool> {
 public:
- container_lexicographical_compare(typename Cntnr1::size_type pos = 0) : m_pos(pos) {}
- bool operator() (Cntnr1 const& x, Cntnr2 const& y)
- {
- typename Cntnr1::const_iterator it1 = x.begin();
- typename Cntnr2::const_iterator it2 = y.begin();
- std::advance(it1, m_pos);
- std::advance(it2, m_pos);
- bool ret = std::lexicographical_compare(it1, x.end(), it2, y.end());
- m_pos = std::distance(x.begin(), it1);
- return ret;
- }
+ container_lexicographical_compare(typename Cntnr1::size_type pos = 0) : m_pos(pos) {}
+ bool operator() (Cntnr1 const& x, Cntnr2 const& y)
+ {
+ typename Cntnr1::const_iterator it1 = x.begin();
+ typename Cntnr2::const_iterator it2 = y.begin();
+ std::advance(it1, m_pos);
+ std::advance(it2, m_pos);
+ bool ret = std::lexicographical_compare(it1, x.end(), it2, y.end());
+ m_pos = std::distance(x.begin(), it1);
+ return ret;
+ }
 private:
- typename Cntnr1::size_type m_pos;
+ typename Cntnr1::size_type m_pos;
 };
 
 //TODO: even more efficient version for strings (using their compare members)

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/forest.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/forest.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/forest.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -44,22 +44,22 @@
     struct enabler {};
 
 public:
- //TODO: Tidy up typedefs
+ //TODO: Tidy up typedefs
 
- typedef Cursor base_cursor;
-
- typedef forest_cursor<Cursor> cursor;
- //typedef const_forest_cursor<Cursor> const_cursor;
-
- //typedef typename cursor_size<base_cursor>::type size_type;
-
- //typedef bidirectional_traversal_tag cursor_category;
-
- // Container-specific:
- typedef cursor iterator; // For (range) concepts' sake, mainly
-// typedef const_cursor const_iterator;
-
- // Common iterator facade stuff
+ typedef Cursor base_cursor;
+
+ typedef forest_cursor<Cursor> cursor;
+ //typedef const_forest_cursor<Cursor> const_cursor;
+
+ //typedef typename cursor_size<base_cursor>::type size_type;
+
+ //typedef bidirectional_traversal_tag cursor_category;
+
+ // Container-specific:
+ typedef cursor iterator; // For (range) concepts' sake, mainly
+// typedef const_cursor const_iterator;
+
+ // Common iterator facade stuff
     forest_cursor()
      : forest_cursor::cursor_adaptor_() {}
 
@@ -71,58 +71,58 @@
         forest_cursor<OtherCursor> const& other
       , typename boost::enable_if<
             boost::is_convertible<OtherCursor*,
- typename Cursor::base_pointer> // is that correct?
+ typename Cursor::base_pointer> // is that correct?
           , enabler
>::type = enabler()
     )
       : forest_cursor::cursor_adaptor_(other.base()) {}
 
- operator base_cursor()
- {
- return this->base();
- }
-
+ operator base_cursor()
+ {
+ return this->base();
+ }
+
 private:
-
+
     friend class cursor_core_access;
     friend class iterator_core_access;
 
-// bool empty_() const
-// {
-// if (this->base().parity())
-// return true;
-// return this->base().empty();
-// }
+// bool empty_() const
+// {
+// if (this->base().parity())
+// return true;
+// return this->base().empty();
+// }
 
- void increment()
+ void increment()
     {
- if (!(++this->base_reference()).empty())
- this->base_reference().to_begin();
+ if (!(++this->base_reference()).empty())
+ this->base_reference().to_begin();
     }
     
     void decrement()
     {
- if (!this->base().parity())
- this->base_reference().to_parent();
- --this->base_reference();
+ if (!this->base().parity())
+ this->base_reference().to_parent();
+ --this->base_reference();
+ }
+
+ // Range stuff.
+
+ // left() remains unchanged, so no need to re-implement it.
+
+ void right()
+ {
+ while (!this->base_reference().to_end().empty());
+ }
+
+ // Cursor stuff.
+
+ void up()
+ {
+ if (!this->base().parity())
+ this->base_reference().to_parent();
     }
-
- // Range stuff.
-
- // left() remains unchanged, so no need to re-implement it.
-
- void right()
- {
- while (!this->base_reference().to_end().empty());
- }
-
- // Cursor stuff.
-
- void up()
- {
- if (!this->base().parity())
- this->base_reference().to_parent();
- }
 };
 
 } // namespace detail

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/multiway.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/multiway.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/multiway.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -39,24 +39,24 @@
     struct enabler {};
 
  public:
- //TODO: Tidy up typedefs
+ //TODO: Tidy up typedefs
 
- typedef Cursor base_cursor;
-
- typedef multiway_tree_cursor<Cursor> cursor;
- typedef const_multiway_tree_cursor<Cursor> const_cursor;
-
- typedef typename cursor_size<base_cursor>::type size_type;
-
- typedef bidirectional_traversal_tag cursor_category;
-
- typedef typename Cursor::metadata_type metadata_type;
-
- // Container-specific:
- typedef cursor iterator; // For (range) concepts' sake, mainly
- typedef const_cursor const_iterator;
-
- // Common iterator facade stuff
+ typedef Cursor base_cursor;
+
+ typedef multiway_tree_cursor<Cursor> cursor;
+ typedef const_multiway_tree_cursor<Cursor> const_cursor;
+
+ typedef typename cursor_size<base_cursor>::type size_type;
+
+ typedef bidirectional_traversal_tag cursor_category;
+
+ typedef typename Cursor::metadata_type metadata_type;
+
+ // Container-specific:
+ typedef cursor iterator; // For (range) concepts' sake, mainly
+ typedef const_cursor const_iterator;
+
+ // Common iterator facade stuff
     const_multiway_tree_cursor()
      : const_multiway_tree_cursor::cursor_adaptor_() {}
 
@@ -68,25 +68,25 @@
         const_multiway_tree_cursor<OtherCursor> const& other
       , typename boost::enable_if<
             boost::is_convertible<OtherCursor*,
- typename Cursor::base_pointer> // is that correct?
+ typename Cursor::base_pointer> // is that correct?
           , enabler
>::type = enabler()
     )
       : const_multiway_tree_cursor::cursor_adaptor_(other.base()) {}
 
- operator base_cursor()
- {
- return this->base();
- }
+ operator base_cursor()
+ {
+ return this->base();
+ }
 
  private:
-
+
     friend class boost::iterator_core_access;
     
- typename const_multiway_tree_cursor::cursor_adaptor_::reference dereference() const
- {
- return this->base()->m_parent->operator[](this->parity());
- }
+ typename const_multiway_tree_cursor::cursor_adaptor_::reference dereference() const
+ {
+ return this->base()->m_parent->operator[](this->parity());
+ }
 };
 
 template <class Cursor>
@@ -99,24 +99,24 @@
> {
  private:
     struct enabler {};
- friend class cursor_core_access;
+ friend class cursor_core_access;
  public:
- //TODO: Tidy up typedefs
+ //TODO: Tidy up typedefs
+
+ typedef Cursor base_cursor;
+
+ typedef multiway_tree_cursor<Cursor> cursor;
+ typedef const_multiway_tree_cursor<Cursor> const_cursor;
 
- typedef Cursor base_cursor;
-
- typedef multiway_tree_cursor<Cursor> cursor;
- typedef const_multiway_tree_cursor<Cursor> const_cursor;
-
- typedef typename cursor_size<base_cursor>::type size_type;
-
- //typedef bidirectional_traversal_tag cursor_category;
-
- // Container-specific:
- typedef cursor iterator; // For (range) concepts' sake, mainly
- typedef const_cursor const_iterator;
-
- // Common iterator facade stuff
+ typedef typename cursor_size<base_cursor>::type size_type;
+
+ //typedef bidirectional_traversal_tag cursor_category;
+
+ // Container-specific:
+ typedef cursor iterator; // For (range) concepts' sake, mainly
+ typedef const_cursor const_iterator;
+
+ // Common iterator facade stuff
     multiway_tree_cursor()
      : multiway_tree_cursor::cursor_adaptor_() {}
 
@@ -128,47 +128,47 @@
         multiway_tree_cursor<OtherCursor> const& other
       , typename boost::enable_if<
             boost::is_convertible<OtherCursor*,
- typename Cursor::base_pointer> // is that correct?
+ typename Cursor::base_pointer> // is that correct?
           , enabler
>::type = enabler()
     )
       : multiway_tree_cursor::cursor_adaptor_(other.base()) {}
 
- operator base_cursor()
- {
- return this->base();
- }
+ operator base_cursor()
+ {
+ return this->base();
+ }
 
 
  private:
-
+
     friend class boost::iterator_core_access;
-
- typename multiway_tree_cursor::cursor_adaptor_::reference dereference() const
- {
- return this->base()->m_parent->operator[](this->parity());
- }
-
+
+ typename multiway_tree_cursor::cursor_adaptor_::reference dereference() const
+ {
+ return this->base()->m_parent->operator[](this->parity());
+ }
+
 public:
- // Range stuff.
-// cursor begin()
-// {
-// return cursor(this->base_reference().begin());
-// }
-
-// const_cursor begin() const
-// {
-// return const_cursor(this->base_reference().begin());
-// }
-
- // Cursor stuff.
-
-// const_cursor parent() const
-// {
-// if (!this->base_reference().parity())) {
-// return this->base_reference().parent();
-// }
-// }
+ // Range stuff.
+// cursor begin()
+// {
+// return cursor(this->base_reference().begin());
+// }
+
+// const_cursor begin() const
+// {
+// return const_cursor(this->base_reference().begin());
+// }
+
+ // Cursor stuff.
+
+// const_cursor parent() const
+// {
+// if (!this->base_reference().parity())) {
+// return this->base_reference().parent();
+// }
+// }
 };
 
 } // namespace detail

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/nary.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/nary.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/cursor/nary.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -34,7 +34,7 @@
 class nary_tree_cursor
  : public cursor_facade<nary_tree_cursor<Node>
       , typename mpl::eval_if<
- is_const<Node>
+ is_const<Node>
                   , add_const<typename Node::value_type>
                   , mpl::identity<typename Node::value_type>
>::type
@@ -42,45 +42,45 @@
       , bidirectional_traversal_tag
> {
  private:
- typedef typename Node::base_type node_base;
-
- typedef typename mpl::eval_if<
- is_const<Node>
- , add_const<node_base>
- , mpl::identity<node_base>
- >::type base_type;
+ typedef typename Node::base_type node_base;
+
+ typedef typename mpl::eval_if<
+ is_const<Node>
+ , add_const<node_base>
+ , mpl::identity<node_base>
+ >::type base_type;
 
- typedef base_type* base_pointer;
-
+ typedef base_type* base_pointer;
+
     struct enabler {};
-
- typedef Node node_type;
- typedef node_type* node_pointer;
-
+
+ typedef Node node_type;
+ typedef node_type* node_pointer;
+
 public:
 
- typedef typename mpl::eval_if<
- is_const<Node>
- , add_const<typename Node::value_type>
- , mpl::identity<typename Node::value_type>
- >::type value_type;
-
- // Container-specific:
- typedef typename node_type::size_type size_type;
-
- // Cursor-specific
- typedef nary_tree_cursor<node_type> cursor;
- typedef nary_tree_cursor<node_type const> const_cursor;
-
- // Container-specific:
- typedef cursor iterator;
- typedef const_cursor const_iterator;
-
- template <class OtherValue>
- struct rebind {
- typedef nary_tree_cursor<OtherValue> other;
- };
-
+ typedef typename mpl::eval_if<
+ is_const<Node>
+ , add_const<typename Node::value_type>
+ , mpl::identity<typename Node::value_type>
+ >::type value_type;
+
+ // Container-specific:
+ typedef typename node_type::size_type size_type;
+
+ // Cursor-specific
+ typedef nary_tree_cursor<node_type> cursor;
+ typedef nary_tree_cursor<node_type const> const_cursor;
+
+ // Container-specific:
+ typedef cursor iterator;
+ typedef const_cursor const_iterator;
+
+ template <class OtherValue>
+ struct rebind {
+ typedef nary_tree_cursor<OtherValue> other;
+ };
+
     nary_tree_cursor()
       : m_node(0), m_pos(0) {}
 
@@ -97,21 +97,21 @@
     )
       : m_node(other.m_node), m_pos(other.m_pos) {}
 
- base_pointer m_node;
- size_type m_pos;
+ base_pointer m_node;
+ size_type m_pos;
 
  private:
 
- friend class iterator_core_access;
+ friend class iterator_core_access;
     friend class cursor_core_access;
     
- friend class access_detach;
-
+ friend class access_detach;
+
     value_type& dereference() const
- {
- return **static_cast<node_type*>(m_node);
- }
-
+ {
+ return **static_cast<node_type*>(m_node);
+ }
+
     bool equal(cursor const& other) const
     {
         return (this->m_node == other.m_node) && (this->m_pos == other.m_pos);
@@ -119,102 +119,102 @@
     
     void increment()
     {
- ++m_pos;
+ ++m_pos;
     }
     
     void decrement()
     {
- --m_pos;
+ --m_pos;
     }
     
- void advance(typename nary_tree_cursor::cursor_facade_::difference_type n)
+ void advance(typename nary_tree_cursor::cursor_facade_::difference_type n)
     {
- m_pos += n;
+ m_pos += n;
     }
     
     typename nary_tree_cursor::cursor_facade_::difference_type
     distance_to(nary_tree_cursor z) const //FIXME: convertible to instead of nary_tree_cursor
     {
- return (z.m_pos - this->m_pos);
+ return (z.m_pos - this->m_pos);
+ }
+
+ // Container specific
+ bool empty_() const
+ {
+ return m_node->operator[](m_pos)->empty();
+ }
+
+ size_type size_() const
+ {
+ return m_node->size();
+ }
+
+ size_type max_size_() const
+ {
+ return m_node->max_size();
+ }
+
+ size_type par() const
+ {
+ return m_pos;
+ }
+
+ void left()
+ {
+ m_node = m_node->operator[](m_pos);
+ m_pos = 0;
+ }
+
+ void right()
+ {
+ size_type new_pos = m_node->size()-1;
+ m_node = m_node->operator[](m_pos);
+ m_pos = new_pos;
+ }
+
+ // Cursor stuff
+ void up()
+ {
+ m_pos = m_node->get_parity();
+ m_node = static_cast<base_pointer>(m_node->parent());
     }
     
- // Container specific
- bool empty_() const
- {
- return m_node->operator[](m_pos)->empty();
- }
-
- size_type size_() const
- {
- return m_node->size();
- }
-
- size_type max_size_() const
- {
- return m_node->max_size();
- }
-
- size_type par() const
- {
- return m_pos;
- }
-
- void left()
- {
- m_node = m_node->operator[](m_pos);
- m_pos = 0;
- }
-
- void right()
- {
- size_type new_pos = m_node->size()-1;
- m_node = m_node->operator[](m_pos);
- m_pos = new_pos;
- }
-
- // Cursor stuff
- void up()
- {
- m_pos = m_node->get_parity();
- m_node = static_cast<base_pointer>(m_node->parent());
- }
-
 protected:
- bool is_on_top() const
- {
- base_pointer parent_begin_node =
- static_cast<base_pointer>(m_node->parent())
- ->operator[](m_node->get_parity());
- return (!m_pos && (m_node != parent_begin_node));
- // (*this != this->parent().begin())
- }
+ bool is_on_top() const
+ {
+ base_pointer parent_begin_node =
+ static_cast<base_pointer>(m_node->parent())
+ ->operator[](m_node->get_parity());
+ return (!m_pos && (m_node != parent_begin_node));
+ // (*this != this->parent().begin())
+ }
 
 public:
- // TODO: protect?
- void attach(node_pointer p_node)
- {
- p_node->m_parent = m_node;
-
- // Only forest-relevant:
- p_node->operator[](1) = m_node->operator[](m_pos);
- m_node->operator[](m_pos)->m_parent = p_node;
-
- m_node->operator[](m_pos) = p_node;
- }
-
-// /**
-// * Detaches the node this cursor points to and returns a pointer to it;
-// * this cursor will be set to its inorder successor afterwards (?)
-// */
-// node_pointer detach()
-// {
-// return static_cast<node_pointer>(m_node->detach(m_pos));
-// }
-//
-// node_pointer detach(cursor y)
-// {
-// return static_cast<node_pointer>(m_node->detach(m_pos, y.m_pos, y.m_node));
-// }
+ // TODO: protect?
+ void attach(node_pointer p_node)
+ {
+ p_node->m_parent = m_node;
+
+ // Only forest-relevant:
+ p_node->operator[](1) = m_node->operator[](m_pos);
+ m_node->operator[](m_pos)->m_parent = p_node;
+
+ m_node->operator[](m_pos) = p_node;
+ }
+
+// /**
+// * Detaches the node this cursor points to and returns a pointer to it;
+// * this cursor will be set to its inorder successor afterwards (?)
+// */
+// node_pointer detach()
+// {
+// return static_cast<node_pointer>(m_node->detach(m_pos));
+// }
+//
+// node_pointer detach(cursor y)
+// {
+// return static_cast<node_pointer>(m_node->detach(m_pos, y.m_pos, y.m_node));
+// }
 
 };
 

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/_order.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/_order.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/_order.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -4,7 +4,7 @@
 // (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-/** @file _order.hpp
+/** @file _order.hpp
  *
  * Some definitions that are identical for all *order cursors (as we are just
  * calling the appropriate traversal function that are defined in the
@@ -18,9 +18,9 @@
 //#include <boost/tree/cursor.hpp>
 
 /**
- * @brief Traversal order iterator adaptor
+ * @brief Traversal order iterator adaptor
  *
- * Only works with ascending cursors.
+ * Only works with ascending cursors.
  */
  
 template <class Cursor>
@@ -50,22 +50,22 @@
     )
       : iterator::iterator_adaptor_(other.base()) {}
 
- operator Cursor()
- {
- return this->base();
- }
+ operator Cursor()
+ {
+ return this->base();
+ }
  private:
     friend class boost::iterator_core_access;
     
     void increment()
     {
- forward(this->base_reference());
- //BOOST_ASSERT(!this->base_reference().parity() || this->base_reference().is_root());
+ forward(this->base_reference());
+ //BOOST_ASSERT(!this->base_reference().parity() || this->base_reference().is_root());
     }
     
     void decrement()
     {
- back(this->base_reference());
- //BOOST_ASSERT(!this->base_reference().parity() || this->base_reference().is_root());
+ back(this->base_reference());
+ //BOOST_ASSERT(!this->base_reference().parity() || this->base_reference().is_root());
     }
 };

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/ascending.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/ascending.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/ascending.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -23,7 +23,7 @@
 
 namespace boost {
 namespace tree {
-
+
 namespace ascending {
 
 template <class Cursor, class Tag = typename cursor_category<Cursor>::type>
@@ -56,16 +56,16 @@
     )
       : iterator::iterator_adaptor_(other.base()) {}
 
- operator Cursor()
- {
- return this->base();
- }
+ operator Cursor()
+ {
+ return this->base();
+ }
  private:
     friend class boost::iterator_core_access;
     
     void increment()
     {
- forward(this->base_reference());
+ forward(this->base_reference());
     }
     
 };

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/augmented.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/augmented.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/augmented.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -29,11 +29,11 @@
 using boost::multi_index::identity;
 
 //TODO: Add extractor as 2nd ctor parameter?
-// Possibly use boost::transform_iterator?
+// 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 Extract = identity<typename InorderIter::value_type>,
+ class Tag = typename std::iterator_traits<InorderIter>::iterator_category
+ >
 class augmented_iterator;
 
 template <class InorderIter, class Extract>
@@ -65,19 +65,19 @@
     )
       : augmented_iterator::iterator_adaptor_(other.base()) {}
 
- operator InorderIter()
- {
- return this->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());
- }
+ typename augmented_iterator::iterator_adaptor_::reference
+ dereference() const
+ {
+ return Extract()(this->base());
+ }
 };
 
 

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/postorder.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/postorder.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/postorder.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -21,7 +21,7 @@
 
 namespace boost {
 namespace tree {
-
+
 namespace postorder {
 
 #include <boost/tree/detail/iterator/_order.hpp>

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/preorder.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/preorder.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/iterator/preorder.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -22,7 +22,7 @@
 
 namespace boost {
 namespace tree {
-
+
 namespace preorder {
 
 #include <boost/tree/detail/iterator/_order.hpp>

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/node/nary.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/node/nary.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/node/nary.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -38,27 +38,27 @@
  */
  
 class node_with_parent_base {
- typedef node_with_parent_base self_type;
- typedef self_type* base_pointer;
- typedef self_type const* const_base_pointer;
+ typedef node_with_parent_base self_type;
+ typedef self_type* base_pointer;
+ typedef self_type const* const_base_pointer;
 
  public:
- base_pointer m_parent; // TODO: protect?
-
- node_with_parent_base()
- {
- m_parent = this;
- }
-
- base_pointer parent()
- {
- return m_parent;
- }
-
- base_pointer const parent() const
- {
- return m_parent;
- }
+ base_pointer m_parent; // TODO: protect?
+
+ node_with_parent_base()
+ {
+ m_parent = this;
+ }
+
+ base_pointer parent()
+ {
+ return m_parent;
+ }
+
+ base_pointer const parent() const
+ {
+ return m_parent;
+ }
 };
 
 template <template <typename> class Container>
@@ -66,180 +66,180 @@
 
 template <template <typename> class Container>
 class node_base : public node_with_parent_base, public Container<node_base<Container>*> {
- typedef node_base<Container> self_type;
-
+ typedef node_base<Container> self_type;
+
  public:
  
- typedef Container<node_base<Container>*> base_type;
- typedef typename base_type::size_type size_type;
- typedef self_type* base_pointer;
- typedef self_type const* const_base_pointer;
-
- node_base() : node_with_parent_base()
- { }
-
- static base_pointer nil()
- {
- static self_type m_nil_obj;
- static base_pointer m_nil = &m_nil_obj;
- return m_nil;
- }
-
- void init()
- {
- for (typename base_type::size_type i=0; i<base_type::size(); ++i)
- operator[](i) = nil();
- }
-
- // This injures Meyers' Item 36. OTOH, iterator adaptors do that, too, right?
- bool const empty() const
- {
- return ((this == nil()) || this->base_type::empty());
- }
-
- // O(n); n is number of parent's children
- typename base_type::size_type const get_parity() const
- {
- typename base_type::size_type i = 0;
- while (static_cast<base_pointer>(this->m_parent)->base_type::operator[](i++) != this);
- return --i;
- //return (static_cast<base_pointer>(this->m_parent)->base_type::operator[](0) == this ? 0 : 1);
- }
+ typedef Container<node_base<Container>*> base_type;
+ typedef typename base_type::size_type size_type;
+ typedef self_type* base_pointer;
+ typedef self_type const* const_base_pointer;
+
+ node_base() : node_with_parent_base()
+ { }
+
+ static base_pointer nil()
+ {
+ static self_type m_nil_obj;
+ static base_pointer m_nil = &m_nil_obj;
+ return m_nil;
+ }
+
+ void init()
+ {
+ for (typename base_type::size_type i=0; i<base_type::size(); ++i)
+ operator[](i) = nil();
+ }
+
+ // This injures Meyers' Item 36. OTOH, iterator adaptors do that, too, right?
+ bool const empty() const
+ {
+ return ((this == nil()) || this->base_type::empty());
+ }
+
+ // O(n); n is number of parent's children
+ typename base_type::size_type const get_parity() const
+ {
+ typename base_type::size_type i = 0;
+ while (static_cast<base_pointer>(this->m_parent)->base_type::operator[](i++) != this);
+ return --i;
+ //return (static_cast<base_pointer>(this->m_parent)->base_type::operator[](0) == this ? 0 : 1);
+ }
 };
 
 template <>
 class node_base<binary_array>
 : public node_with_parent_base, public binary_array<node_base<binary_array>*> {
- typedef node_base<binary_array> self_type;
-
+ typedef node_base<binary_array> self_type;
+
  public:
  
- typedef binary_array<node_base*> base_type;
- typedef self_type* base_pointer;
- typedef self_type const* const_base_pointer;
-
- node_base() : node_with_parent_base()
- { }
-
- static base_pointer nil()
- {
- static self_type m_nil_obj;
- static base_pointer m_nil = &m_nil_obj;
- return m_nil;
- }
-
- void init()
- {
- for (base_type::size_type i=0; i<base_type::max_size(); ++i)
- operator[](i) = nil();
- }
-
- // This injures Meyers' Item 36. OTOH, iterator adaptors do that, too, right?
- bool const empty() const
- {
- return (this == nil());
- }
-
- // Binary specific
-
- base_type::size_type rotate(base_type::size_type const& c)
- {
- //TODO: Optimise.
- base_pointer q = base_type::operator[](c);
-
- base_pointer B = (base_type::operator[](c))->base_type::operator[](c ? 0 : 1);
- //pre_rotate();
-
- //B swaps places with its m_parent:
-
- base_type::operator[](c) = B;
- B->m_parent = this;
- q->m_parent = this->m_parent;
-
- base_type::size_type qp = get_parity();
- static_cast<base_pointer>(q->m_parent)->base_type::operator[](qp) = q;
- this->m_parent = q;
- q->base_type::operator[](c ? 0 : 1) = this;
- return qp;
- //return (c ? 0 : 1);
- }
-
- base_pointer detach(base_type::size_type m_pos)
- {
- base_pointer q = base_type::operator[](m_pos);
- base_type::operator[](m_pos) =
- base_type::operator[](m_pos)
- ->base_type::operator[]((base_type::operator[](m_pos))
- ->base_type::operator[](0) == node_base::nil() ? 1 : 0);
- base_type::operator[](m_pos)->m_parent = this;
- return q;
- }
-
- // TODO: actually implement this.
- base_pointer detach(base_type::size_type parity,
- base_type::size_type other_parity,
- base_pointer other)
- {
- //Node::pre_splice(q, r);
- // splice out q
- base_pointer x = detach(parity);
-
- // q has been spliced out, now relink it in place of r.
- static_cast<base_pointer>(other->m_parent)->base_type::operator[](other_parity) = this;
- m_parent = other->m_parent;
-
- for (base_type::size_type i=0; i<base_type::max_size(); ++i) {
- base_type::operator[](i) = other->base_type::operator[](i);
- base_type::operator[](i)->m_parent = this;
- }
- return x;
- }
-
- // O(1)
- base_type::size_type const get_parity() const
- {
- return (static_cast<base_pointer>(this->m_parent)->base_type::operator[](0) == this ? 0 : 1);
- }
-
+ typedef binary_array<node_base*> base_type;
+ typedef self_type* base_pointer;
+ typedef self_type const* const_base_pointer;
+
+ node_base() : node_with_parent_base()
+ { }
+
+ static base_pointer nil()
+ {
+ static self_type m_nil_obj;
+ static base_pointer m_nil = &m_nil_obj;
+ return m_nil;
+ }
+
+ void init()
+ {
+ for (base_type::size_type i=0; i<base_type::max_size(); ++i)
+ operator[](i) = nil();
+ }
+
+ // This injures Meyers' Item 36. OTOH, iterator adaptors do that, too, right?
+ bool const empty() const
+ {
+ return (this == nil());
+ }
+
+ // Binary specific
+
+ base_type::size_type rotate(base_type::size_type const& c)
+ {
+ //TODO: Optimise.
+ base_pointer q = base_type::operator[](c);
+
+ base_pointer B = (base_type::operator[](c))->base_type::operator[](c ? 0 : 1);
+ //pre_rotate();
+
+ //B swaps places with its m_parent:
+
+ base_type::operator[](c) = B;
+ B->m_parent = this;
+ q->m_parent = this->m_parent;
+
+ base_type::size_type qp = get_parity();
+ static_cast<base_pointer>(q->m_parent)->base_type::operator[](qp) = q;
+ this->m_parent = q;
+ q->base_type::operator[](c ? 0 : 1) = this;
+ return qp;
+ //return (c ? 0 : 1);
+ }
+
+ base_pointer detach(base_type::size_type m_pos)
+ {
+ base_pointer q = base_type::operator[](m_pos);
+ base_type::operator[](m_pos) =
+ base_type::operator[](m_pos)
+ ->base_type::operator[]((base_type::operator[](m_pos))
+ ->base_type::operator[](0) == node_base::nil() ? 1 : 0);
+ base_type::operator[](m_pos)->m_parent = this;
+ return q;
+ }
+
+ // TODO: actually implement this.
+ base_pointer detach(base_type::size_type parity,
+ base_type::size_type other_parity,
+ base_pointer other)
+ {
+ //Node::pre_splice(q, r);
+ // splice out q
+ base_pointer x = detach(parity);
+
+ // q has been spliced out, now relink it in place of r.
+ static_cast<base_pointer>(other->m_parent)->base_type::operator[](other_parity) = this;
+ m_parent = other->m_parent;
+
+ for (base_type::size_type i=0; i<base_type::max_size(); ++i) {
+ base_type::operator[](i) = other->base_type::operator[](i);
+ base_type::operator[](i)->m_parent = this;
+ }
+ return x;
+ }
+
+ // O(1)
+ base_type::size_type const get_parity() const
+ {
+ return (static_cast<base_pointer>(this->m_parent)->base_type::operator[](0) == this ? 0 : 1);
+ }
+
 };
 
 template <typename T, template <typename> class Container>
 class node : public node_base<Container> {
  public:
- typedef T value_type;
-
- typedef Container<node_base<Container>*> container_type;
-
- typedef node<value_type, Container> node_type;
- typedef node_type* node_pointer;
- typedef node_type& node_reference;
- //typedef node_pointer position_type;
- typedef node_base<Container> base_type;
- typedef base_type* base_pointer;
- typedef base_type const* const_base_pointer;
-
- typedef value_type& reference;
- typedef value_type const& const_reference;
- typedef value_type* pointer;
-
- //enum size_t { first = 0, second = 1 };
- //typedef std::size_t size_type;
-
- // TODO: add observers.
-
- reference operator*() { return *m_data; }
-
- const_reference operator*() const { return *m_data; }
-
- node(pointer data) : base_type(), m_data(data) {}
-
- pointer data()
- {
- return m_data;
- }
-
+ typedef T value_type;
+
+ typedef Container<node_base<Container>*> container_type;
+
+ typedef node<value_type, Container> node_type;
+ typedef node_type* node_pointer;
+ typedef node_type& node_reference;
+ //typedef node_pointer position_type;
+ typedef node_base<Container> base_type;
+ typedef base_type* base_pointer;
+ typedef base_type const* const_base_pointer;
+
+ typedef value_type& reference;
+ typedef value_type const& const_reference;
+ typedef value_type* pointer;
+
+ //enum size_t { first = 0, second = 1 };
+ //typedef std::size_t size_type;
+
+ // TODO: add observers.
+
+ reference operator*() { return *m_data; }
+
+ const_reference operator*() const { return *m_data; }
+
+ node(pointer data) : base_type(), m_data(data) {}
+
+ pointer data()
+ {
+ return m_data;
+ }
+
  private:
- pointer m_data;
+ pointer m_data;
 };
 
 } // namespace detail

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/node/traits.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/node/traits.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/node/traits.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -17,23 +17,23 @@
 template <class Node>
 struct node_traits
 {
- typedef Node node_type;
-
- // Value
- typedef typename node_type::value_type value_type;
- typedef typename node_type::pointer pointer;
- typedef typename node_type::reference reference;
- //typedef typename node_type::size_type size_type;
-
- // Node
- typedef typename node_type::node_pointer node_pointer;
- typedef typename node_type::node_reference node_reference;
-
- // Node base
- typedef typename node_type::base_type node_base_type;
- typedef typename node_type::base_pointer node_base_pointer;
-
- typedef node_base_pointer position_type;
+ typedef Node node_type;
+
+ // Value
+ typedef typename node_type::value_type value_type;
+ typedef typename node_type::pointer pointer;
+ typedef typename node_type::reference reference;
+ //typedef typename node_type::size_type size_type;
+
+ // Node
+ typedef typename node_type::node_pointer node_pointer;
+ typedef typename node_type::node_reference node_reference;
+
+ // Node base
+ typedef typename node_type::base_type node_base_type;
+ typedef typename node_type::base_pointer node_base_pointer;
+
+ typedef node_base_pointer position_type;
 };
 
 } // namespace tree

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/range_helpers.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/range_helpers.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/range_helpers.hpp 2008-09-17 17:07:09 EDT (Wed, 17 Sep 2008)
@@ -25,8 +25,8 @@
 
 #include <boost/range.hpp>
 
-#include <algorithm> // lower_bound, upper_bound etc.
-#include <functional> // ptr_fun, not1, tr1::bind
+#include <algorithm> // lower_bound, upper_bound etc.
+#include <functional> // ptr_fun, not1, tr1::bind
 
 
 namespace boost {
@@ -36,58 +36,58 @@
 
 /**
  * @brief \c lower_bound substitute for (efficient) \b binary tree search.
- * @param first Iterator
- * @param last Iterator
- * @param val Search key
- * @param cmp Comparison functor
- * @return An iterator to the first element "not less than" @a val,
- * or @a last if every element is less than @a val.
+ * @param first Iterator
+ * @param last Iterator
+ * @param val Search key
+ * @param cmp Comparison functor
+ * @return An iterator to the first element "not less than" @a val,
+ * or @a last if every element is less than @a val.
  *
  * Compares only @a first's value to @a val
 */
 template<class ForwardIterator, typename T, typename Compare>
 ForwardIterator
 binary_lower_bound(ForwardIterator first, ForwardIterator last,
- T const& val, Compare cmp)
+ T const& val, Compare cmp)
 {
- return cmp(*first, val) ? last : first;
+ return cmp(*first, val) ? last : first;
 }
 
 
 /**
  * @brief \c upper_bound substitute for (efficient) \b binary tree search.
- * @param first Iterator
- * @param last Iterator
- * @param val Search key
- * @param cmp Comparison functor
- * @return An iterator to the first element "greater than" @a val,
- * or @a last if no element is greater than @a val.
+ * @param first Iterator
+ * @param last Iterator
+ * @param val Search key
+ * @param cmp Comparison functor
+ * @return An iterator to the first element "greater than" @a val,
+ * or @a last if no element is greater than @a val.
  *
  * Compares only @a first's value to @a val.
 */
 template<class ForwardIterator, typename T, typename Compare>
 ForwardIterator
 binary_upper_bound(ForwardIterator first, ForwardIterator last,
- T const& val, Compare cmp)
+ T const& val, Compare cmp)
 {
- return cmp(val, *first) ? first : last;
+ return cmp(val, *first) ? first : last;
 }
 
 
 template<class InputIterator, typename T, typename Compare>
 inline InputIterator
 linear_lower_bound(InputIterator first, InputIterator last,
- T const& val, Compare cmp)
+ T const& val, Compare cmp)
 {
- return std::find_if(first, last, !bind(cmp, _1, val));
+ return std::find_if(first, last, !bind(cmp, _1, val));
 }
 
 template<class InputIterator, typename T, typename Compare>
 inline InputIterator
 linear_upper_bound(InputIterator first, InputIterator last,
- T const& val, Compare cmp)
+ T const& val, Compare cmp)
 {
- return std::find_if(first, last, bind(cmp, val, _1));
+ return std::find_if(first, last, bind(cmp, val, _1));
 }
 
 //template< class ForwardReadableRange, class T >
@@ -109,14 +109,14 @@
 inline typename boost::range_iterator<ForwardReadableRange>::type
 lower_bound(ForwardReadableRange r, T const& val, Cmp cmp)
 {
- return std::lower_bound(boost::begin(r), boost::end(r), val, cmp);
+ return std::lower_bound(boost::begin(r), boost::end(r), val, cmp);
 }
 
 template <class ForwardReadableRange, class T, class Cmp>
 inline typename boost::range_const_iterator<ForwardReadableRange>::type
 lower_bound(ForwardReadableRange r, T const& val, Cmp cmp)
 {
- return std::lower_bound(boost::begin(r), boost::end(r), val, cmp);
+ return std::lower_bound(boost::begin(r), boost::end(r), val, cmp);
 }
 
 


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