Advertisement
Auios

Untitled

Dec 9th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. iterator begin()
  2.     {
  3.         iterator it(this->root_, this);
  4.         if (root_){ while (it.node_->left_){ --it; } }
  5.         return it;
  6.     }
  7.    
  8.  
  9.     iterator end()
  10.     {
  11.         iterator it(this->root_, this);
  12.        
  13.         if (root_)
  14.         {
  15.             while (it.node_->right_) { ++it; }
  16.             ++it;
  17.         }
  18.  
  19.         return it;
  20.         return iterator(nullptr, this);
  21.     }
  22.    
  23.    
  24.     const_iterator cbegin()const {
  25.        
  26.         const_iterator it(this->root_, this);
  27.        
  28.         if (root_) { while (it.node_->left_){ --it; } }
  29.  
  30.         return it;
  31.     }
  32.    
  33.    
  34.     const_iterator cend() const
  35.     {
  36.         const_iterator it(this->root_, this);
  37.        
  38.         if (root_)
  39.         {
  40.             while (it.node_->right_) { ++it; }
  41.             ++it;
  42.         }
  43.  
  44.         return it;
  45.         return const_iterator(nullptr, this);
  46.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement