Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- iterator begin()
- {
- iterator it(this->root_, this);
- if (root_){ while (it.node_->left_){ --it; } }
- return it;
- }
- iterator end()
- {
- iterator it(this->root_, this);
- if (root_)
- {
- while (it.node_->right_) { ++it; }
- ++it;
- }
- return it;
- return iterator(nullptr, this);
- }
- const_iterator cbegin()const {
- const_iterator it(this->root_, this);
- if (root_) { while (it.node_->left_){ --it; } }
- return it;
- }
- const_iterator cend() const
- {
- const_iterator it(this->root_, this);
- if (root_)
- {
- while (it.node_->right_) { ++it; }
- ++it;
- }
- return it;
- return const_iterator(nullptr, this);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement