42 for (
size_t a = 0, b = 1, t = 0; b <= n; t = a + b + 1, a = b, b = t, ++h)
58template <
class TNode,
class TAlloc>
60 std::allocator_traits<TAlloc>::template rebind_alloc<TNode>;
70template <
class TNode,
class TAlloc>
72 std::allocator_traits<avl_node_allocator_type<TNode, TAlloc>>::pointer;
75template <
class TKey,
class TItem,
class TKeyComp,
class TAlloc,
class TNode>
100 using size_type =
typename node_alloc_traits::size_type;
120 requires(!std::is_invocable_v<T>)
131 template <
class TCallback>
132 requires std::is_invocable_v<TCallback>
Implementation of the common AVL tree features.
Base class for avl trees.
Definition _avl_common.hpp:76
TKey key_type
Definition _avl_common.hpp:78
avl_node_allocator_type< node_type, allocator_type > node_alloc_type
The node allocator type.
Definition _avl_common.hpp:85
static node_ptr min_from(node_ptr node) noexcept
Finds the minimum value starting at the given node.
Definition _avl_common.ipp:72
virtual ~avl_tree_base()=0
avl_tree_base(comparator_type &&comparator, allocator_type &&allocator) noexcept
Definition _avl_common.hpp:143
static node_ptr max_from(node_ptr node) noexcept
Finds the maximum value starting at the given node.
Definition _avl_common.ipp:85
TNode node_type
Definition _avl_common.hpp:82
avl_sign_type sign_type
Definition _avl_common.hpp:103
TItem item_type
Definition _avl_common.hpp:79
avl_node_ptr< node_type, allocator_type > node_ptr
The node pointer type.
Definition _avl_common.hpp:90
TKeyComp comparator_type
Definition _avl_common.hpp:80
TAlloc allocator_type
Definition _avl_common.hpp:81
node_ptr create_node(T &&item)
Constructs a new node with the given item.
Definition _avl_common.ipp:28
comparator_type comparator
Definition _avl_common.hpp:105
void destroy_node(node_ptr node) noexcept
Destroys the node and frees the memory.
Definition _avl_common.ipp:62
avl_tree_base(const comparator_type &comparator, const allocator_type &allocator)
Definition _avl_common.hpp:139
node_alloc_type get_allocator() const noexcept
Returns the associated allocator.
Definition _avl_common.hpp:152
node_alloc_type allocator
Definition _avl_common.hpp:106
std::allocator_traits< node_alloc_type > node_alloc_traits
Node allocator traits.
Definition _avl_common.hpp:95
typename node_alloc_traits::size_type size_type
The size type.
Definition _avl_common.hpp:100
int8_t avl_sign_type
The type to use for the trinary sign value for each node.
Definition _avl_common.hpp:50
int avl_calc_max_height(size_t n)
Returns the maximum allowed height for an AVL tree of given size.
Definition _avl_common.hpp:40
std::allocator_traits< TAlloc >::template rebind_alloc< TNode > avl_node_allocator_type
An allocator to allocate nodes.
Definition _avl_common.hpp:60
std::allocator_traits< avl_node_allocator_type< TNode, TAlloc > >::pointer avl_node_ptr
A node pointer type.
Definition _avl_common.hpp:72
Declarations of the persistent map.
Definition _avl.hpp:14