|
| template<class OTHER_VALUE , class OTHER_NODE , class OTHER_DIFFERENCE_TYPE > |
| class | TreeIterator |
| |
| template<class VALUE1 , class VALUE2 , class NODEPTR , class DIFF > |
| bool | operator== (const TreeIterator< VALUE1, NODEPTR, DIFF > &, const TreeIterator< VALUE2, NODEPTR, DIFF > &) |
| |
| template<class VALUE1 , class VALUE2 , class NODEPTR , class DIFF > |
| bool | operator!= (const TreeIterator< VALUE1, NODEPTR, DIFF > &, const TreeIterator< VALUE2, NODEPTR, DIFF > &) |
| |
template<class VALUE, class NODE, class DIFFERENCE_TYPE>
class bslstl::TreeIterator< VALUE, NODE, DIFFERENCE_TYPE >
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).
template<class VALUE , class NODE , class DIFFERENCE_TYPE >
template<class VALUE1 , class VALUE2 , class NODEPTR , class DIFF >
| bool operator!= |
( |
const TreeIterator< VALUE1, NODEPTR, DIFF > & |
lhs, |
|
|
const TreeIterator< VALUE2, NODEPTR, DIFF > & |
rhs |
|
) |
| |
|
friend |
Return true if the specified lhs and the specified rhs iterators do not have the same value and false otherwise. Two iterators do not have the same value if they differ in either the tree to which they refer or the position in that tree.
template<class VALUE , class NODE , class DIFFERENCE_TYPE >
template<class VALUE1 , class VALUE2 , class NODEPTR , class DIFF >
| bool operator== |
( |
const TreeIterator< VALUE1, NODEPTR, DIFF > & |
lhs, |
|
|
const TreeIterator< VALUE2, NODEPTR, DIFF > & |
rhs |
|
) |
| |
|
friend |
Return true if the specified lhs and the specified rhs iterators have the same value and false otherwise. Two iterators have the same value if they refer to the same position in the same tree, or if both iterators are at an invalid position in the tree (i.e., the end of the tree, or the default constructed value).