67 bool operator == (
Direction_e o)
const {
return d == o; }
68 bool operator != (
Direction_e o)
const {
return d != o; }
69 bool operator == (
Direction o)
const {
return d == o.d; }
70 bool operator != (
Direction o)
const {
return d != o.d; }
80 template<
typename Node,
typename Get_key,
typename Compare >
95 {
return p->_c[d.d]; }
103 {
return &p->_c[d.d]; }
106 template<
typename Node >
static
108 {
return static_cast<Node *
>(p->_c[d.d]); }
130 *t =
next(tmp, idir);
132 next(*t, !idir, tmp);
Basic type of a node in a binary search tree (BST).
static Node * next(Bst_node const *p, Direction d)
Get next node in direction d as type Node.
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 Bst_node * next(Bst_node const *p, Direction d)
Get next node in direction d.
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.
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)
Direction()=default
Uninitialized direction.
Direction operator!() const
Negate the direction.
Direction_e
The literal direction values.
@ R
Go to the right child.