|
datastructures 0.1.0
|
The AVL tree iterator type. More...
#include <_avl_iterator.hpp>
Public Types | |
| using | iterator_category = std::bidirectional_iterator_tag |
| Tells the compiler that this iterator is bidirectional, needed by STL. | |
| using | value_type = typename tree_type::item_type |
| The tree item type, needed by STL. | |
| using | difference_type = typename alloc_traits::difference_type |
| Item pointer difference type, needed by STL. | |
| using | pointer = std::conditional_t< is_const, typename alloc_traits::const_pointer, typename alloc_traits::pointer > |
| Item pointer, needed by STL. | |
| using | reference = std::conditional_t< is_const, const value_type &, value_type & > |
| Item pointer, needed by STL. | |
| using | iterator_concept = std::bidirectional_iterator_tag |
| Tells the compiler that this iterator is bidirectional, needed by STL. | |
Public Member Functions | |
| avl_iterator (tree_ptr tree, node_ptr node) noexcept | |
| Creates a new iterator to the given tree. | |
| avl_iterator () noexcept | |
Same as avl_iterator(nullptr, nullptr). | |
| avl_iterator (const avl_iterator &other) noexcept | |
| avl_iterator & | operator= (const avl_iterator &other) noexcept |
| ~avl_iterator () noexcept=default | |
| avl_iterator (const avl_iterator< tree_type, false > &other) noexcept | |
| reference | operator* () const noexcept |
| pointer | operator-> () const noexcept |
| avl_iterator & | operator++ () noexcept |
| avl_iterator | operator++ (int) noexcept |
| avl_iterator & | operator-- () noexcept |
| avl_iterator | operator-- (int) noexcept |
| bool | operator== (const avl_iterator &other) const noexcept |
| bool | operator!= (const avl_iterator &other) const noexcept |
Friends | |
| class | avl_iterator< tree_type, true > |
| template<class , class , class , class > | |
| class | ::datastructures::map |
The AVL tree iterator type.
A bidirectional itertator to iterate through the tree using the successor fnuction, which amortizes to O(1) per node when iterating through the whole tree.
Implements both the normal and constant variant using the is_const compile-time flag.
Compatible with the STL.
| TTree | The internal tree type. |
| is_const | When true this will be a const_iterator; iterator otherwise. |
| using datastructures::detail::avl_iterator< TTree, is_const >::difference_type = typename alloc_traits::difference_type |
Item pointer difference type, needed by STL.
| using datastructures::detail::avl_iterator< TTree, is_const >::iterator_category = std::bidirectional_iterator_tag |
Tells the compiler that this iterator is bidirectional, needed by STL.
| using datastructures::detail::avl_iterator< TTree, is_const >::iterator_concept = std::bidirectional_iterator_tag |
Tells the compiler that this iterator is bidirectional, needed by STL.
| using datastructures::detail::avl_iterator< TTree, is_const >::pointer = std::conditional_t<is_const, typename alloc_traits::const_pointer, typename alloc_traits::pointer> |
Item pointer, needed by STL.
Usually value_type * or the constant variant.
| using datastructures::detail::avl_iterator< TTree, is_const >::reference = std::conditional_t<is_const, const value_type &, value_type &> |
Item pointer, needed by STL.
Usually value_type & or the constant variant.
| using datastructures::detail::avl_iterator< TTree, is_const >::value_type = typename tree_type::item_type |
The tree item type, needed by STL.
|
inlinenoexcept |
Creates a new iterator to the given tree.
| tree | Can be a nullptr in that case the the iterator will not belong to any tree and will not be equal to any past-the-end iterators of any object and every subsequent operation is UB. |
| node | Can be a nullptr, in that case the iterator will be a past-the-end iterator of the given tree. |
|
inlinenoexcept |
Same as avl_iterator(nullptr, nullptr).
|
inlinenoexcept |
|
defaultnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
friend |
|
friend |