84 template<
typename Node,
typename Get_key,
typename Compare >
99 {
return p->_c[d.d]; }
107 {
return &p->_c[d.d]; }
110 template<
typename Node >
static
112 {
return static_cast<Node *
>(p->_c[d.d]); }
134 *t =
next(tmp, idir);
136 next(*t, !idir, tmp);
Basic type of a node in a binary search tree (BST).
static void next(Bst_node *p, Direction d, Bst_node *n)
Set next node of p in direction d to n.
static Bst_node ** next_p(Bst_node *p, Direction d)
Get pointer to link in direction d.
static Node * next(Bst_node const *p, Direction d)
Get next node in direction d as type Node.
Bst_node(bool)
Create initialized node.
static void rotate(Bst_node **t, Direction idir)
Rotate subtree t in the opposite direction of idir.
Bst_node()
Create uninitialized node.
static Bst_node * next(Bst_node const *p, Direction d)
Get next node in direction d.
Basic binary search tree (BST).
The direction to go in a binary search tree.
Direction(Direction_e d)
Convert a literal direction (L, R, N) to an object.
Direction(bool b)
Convert a boolean to a direction (false == L, true == R)
bool operator!=(Direction_e o) const
Compare for inequality.
bool operator==(Direction_e o) const
Compare for equality.
Direction()=default
Uninitialized direction.
Direction operator!() const
Negate the direction.
Direction_e
The literal direction values.
@ R
Go to the right child.