This class provides an STL‐conforming bidirectional iterator over the ordered bslalg::RbTreeNode objects in a binary tree (see section [24.2.6 bidirectional.iterators]of the C++11 standard). A TreeIterator provides access to values of the parameterized VALUE, over a binary tree composed of nodes of the parameterized NODE (which must derive from bslalg::RbTreeNode). The parameterized DIFFERENCE_TYPE determines the standard required difference_type of the iterator, without requiring access to the allocator‐traits for the node. The behavior of the operator* method is undefined unless the iterator is at a valid position in the tree (i.e., not the end) and the referenced element has not been removed since the iterator was constructed. NODE must derives from bslalg::RbTreeNode, and contains a value method that returns a reference providing modifiable access to a type that is convertible to the parameterized VALUE (e.g., a bslstl::TreeNode object).
Synopsis
Declared in <bslstl_treeiterator.h>
template<
class VALUE,
class NODE,
class DIFFERENCE_TYPE>
class TreeIterator;
Type Aliases
Name |
Description |
The difference type for this iterator. |
|
The STL iterator category tag for this iterator. |
|
Pointer type for the value referred to by this iterator. |
|
Standard iterator defined types [24.4.2]. |
|
The value type referred to by this iterator. |
Member Functions
Name |
Description |
|
Constructors |
Return the address of the non‐modifiable tree node at which this iterator is positioned, or 0 if this iterator is not at a valid position in the tree. Note that this method is an implementation detail and is not part of the C++ standard. |
|
Return a reference providing modifiable access to the value (of the parameterized |
|
Move this iterator to the next element in the tree and return a reference providing modifiable access to this iterator. The behavior is undefined unless the iterator refers to an element in the tree. |
|
Move this iterator to the previous element in the tree and return a reference providing modifiable access to this iterator. The behavior is undefined unless the iterator refers to the past‐the‐end address or the non‐leftmost element in the tree. |
|
Return the address of the value (of the parameterized |
Friends
Name |
Description |
|
This class provides an STL‐conforming bidirectional iterator over the ordered |
Return whether the specified iterators refer to the same tree node. |
Non-Member Functions
Name |
Description |
Move the specified |
|
Move the specified |
|
Return |
Created with MrDocs