Boost logo

Boost-Commit :

From: chintanraoh_at_[hidden]
Date: 2008-06-03 16:31:54


Author: chintanraoh
Date: 2008-06-03 16:31:54 EDT (Tue, 03 Jun 2008)
New Revision: 46089
URL: http://svn.boost.org/trac/boost/changeset/46089

Log:
Added get_key(it) instead of modifying the node_iterator.
Text files modified:
   sandbox/SOC/2008/digital_searching/dsearch/boost/dsearch/trie_array_node.hpp | 13 +++++++++++--
   1 files changed, 11 insertions(+), 2 deletions(-)

Modified: sandbox/SOC/2008/digital_searching/dsearch/boost/dsearch/trie_array_node.hpp
==============================================================================
--- sandbox/SOC/2008/digital_searching/dsearch/boost/dsearch/trie_array_node.hpp (original)
+++ sandbox/SOC/2008/digital_searching/dsearch/boost/dsearch/trie_array_node.hpp 2008-06-03 16:31:54 EDT (Tue, 03 Jun 2008)
@@ -151,12 +151,21 @@
         std::size_t size()
         {
                 int t_size=0;
- for(int i=0;i<max;i++)
- if(child_ptr[i]!=0)
+ for ( int i=0; i<max; i++ )
+ if( child_ptr[i]!=0 )
                                 t_size++;
                 return t_size;
         }
 
+ iterator lower_bound(const element_type &e)
+ {
+ int k=Key_traits::get_value(e);
+ for(;k>=0;k--)
+ if(child_ptr[k]!=0) break;
+ if(k<0) return end();
+ return iterator(this,k);
+ }
+
         bool empty()
         {
                 for(int i=0;i<max;i++)


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