Boost logo

Boost-Commit :

From: ockham_at_[hidden]
Date: 2008-06-07 07:57:28


Author: bernhard.reiter
Date: 2008-06-07 07:57:27 EDT (Sat, 07 Jun 2008)
New Revision: 46211
URL: http://svn.boost.org/trac/boost/changeset/46211

Log:
Remove shoot argument from inorder::lower_bound
Text files modified:
   sandbox/SOC/2006/tree/trunk/TODO | 2 +-
   sandbox/SOC/2006/tree/trunk/boost/tree/balanced_tree.hpp | 4 ++--
   sandbox/SOC/2006/tree/trunk/boost/tree/search.hpp | 7 ++++---
   sandbox/SOC/2006/tree/trunk/libs/tree/test/binary_tree_test.cpp | 2 +-
   4 files changed, 8 insertions(+), 7 deletions(-)

Modified: sandbox/SOC/2006/tree/trunk/TODO
==============================================================================
--- sandbox/SOC/2006/tree/trunk/TODO (original)
+++ sandbox/SOC/2006/tree/trunk/TODO 2008-06-07 07:57:27 EDT (Sat, 07 Jun 2008)
@@ -20,7 +20,7 @@
   as they are otherwise limited to "whole" trees and cannot be applied to subtrees.
   In order to work for subtrees, it's probable that we need at least an int to store
   the current depth. (Which, in turn, would make the free-standing forward/back/next/prior
- algortihms etc. more or less useless without that piece of extra information and would
+ algorithms etc. more or less useless without that piece of extra information and would
   only leave us with the iterators to store it.)
 * Deprecate shoot()? It's main use was for inorder::end(), which is now root().
   Would (binary tree) lower_bound() be possible without shoot()? What would it have to be

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/balanced_tree.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/balanced_tree.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/balanced_tree.hpp 2008-06-07 07:57:27 EDT (Sat, 07 Jun 2008)
@@ -244,7 +244,7 @@
          template <class Cmp>
          iterator lower_bound(value_type const& k, Cmp cmp)
          {
- return iterator(boost::tree::lower_bound(h.root(), h.shoot(), k,
+ return iterator(boost::tree::lower_bound(h.root(), k,
                          bind<bool>(cmp, bind(typename data_type::extract_data(), _1), _2)));
          }
 
@@ -261,7 +261,7 @@
          template <class Cmp>
          const_iterator lower_bound(value_type const& k, Cmp cmp) const
          {
- return const_iterator(boost::tree::lower_bound(h.croot(), h.cshoot(), k,
+ return const_iterator(boost::tree::lower_bound(h.croot(), k,
                          bind<bool>(cmp, bind(typename data_type::extract_data(), _1), _2)));
          }
                   

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/search.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/search.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/search.hpp 2008-06-07 07:57:27 EDT (Sat, 07 Jun 2008)
@@ -41,8 +41,9 @@
  * @a val.
  */
 template <class MultiwayCursor, class T>
-MultiwayCursor lower_bound(MultiwayCursor x, MultiwayCursor y, T const& val)
+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)
@@ -64,9 +65,9 @@
  * @a val.
  */
 template <class MultiwayCursor, class T, class Cmp>
-MultiwayCursor lower_bound(MultiwayCursor x, MultiwayCursor y, T const& val,
- Cmp 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)

Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/binary_tree_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/binary_tree_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/binary_tree_test.cpp 2008-06-07 07:57:27 EDT (Sat, 07 Jun 2008)
@@ -66,7 +66,7 @@
         --c4;
         BOOST_CHECK(*c4 == 2);
         BOOST_CHECK(c4.parent() == c1);
- c = boost::tree::lower_bound(mytree.root(), mytree.shoot(), 2, std::less<int>());
+ c = boost::tree::lower_bound(mytree.root(), 2, std::less<int>());
         BOOST_CHECK(*c == 2);
         BOOST_CHECK(c4.empty());
 


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