Boost logo

Boost-Commit :

From: chintanraoh_at_[hidden]
Date: 2008-05-31 13:54:11


Author: chintanraoh
Date: 2008-05-31 13:54:10 EDT (Sat, 31 May 2008)
New Revision: 45980
URL: http://svn.boost.org/trac/boost/changeset/45980

Log:
fixes a cursor bug when cursor is on top.
Text files modified:
   sandbox/SOC/2008/digital_searching/dsearch/boost/dsearch/node_cursor.hpp | 11 ++++++++++-
   1 files changed, 10 insertions(+), 1 deletions(-)

Modified: sandbox/SOC/2008/digital_searching/dsearch/boost/dsearch/node_cursor.hpp
==============================================================================
--- sandbox/SOC/2008/digital_searching/dsearch/boost/dsearch/node_cursor.hpp (original)
+++ sandbox/SOC/2008/digital_searching/dsearch/boost/dsearch/node_cursor.hpp 2008-05-31 13:54:10 EDT (Sat, 31 May 2008)
@@ -27,8 +27,9 @@
                 node_iterator pos;
 
                 public:
- trie_cursor(bool t=false):top(t)
+ trie_cursor()// :only_root(0),cur(0),top(0) (gave warnings!?!)
                 {
+ only_root=0;cur=0;top=0;
                 }
 
                 trie_cursor(Node * const n_ptr): only_root(1) , top(false)
@@ -65,6 +66,10 @@
 
                 cursor left() const
                 {
+ if(top)
+ {
+ return cursor(cur);
+ }
                         if(only_root)
                                 return cursor(cur,cur->begin());
                         return cursor(*pos,(*pos)->begin());
@@ -72,6 +77,10 @@
 
                 cursor right() const
                 {
+ if(top)
+ {
+ return (cursor(cur)++);
+ }
                         if(only_root)
                                 return cursor(cur,cur->end());
                         return cursor(*pos,(*pos)->end());


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