Ordered
Most of the time when using Ordered you will want the value type to be a std::pair. Ordered can support other value types, such as std::tuple (using KeyValueExtractor = TupleExtractor) and even arbitrary user defined classes, but they require a carefully crafted KeyValueExtractor to work properly.
-
template<typename KeyValue, typename KeyValueExtractor = PairExtractor<0>, typename LessThan = MinComparator, typename BinarySearch = std::false_type>
struct Ordered Ordered mixin adds lookup by key into a B++ tree. Values in the B++ tree must be ordered by key to use Ordered. Supports lookup, lower_bound, upper_bound, assign, insert, update, and erase by key in O(log N) time
- Template Parameters:
KeyValue – the element type of the B++ tree
KeyValueExtractor – a class which implements functions to get a key from a KeyValue, get a value from a KeyValue, or forward a key and value to another function in the correct order
LessThan – a class which implements operator()(A const& a, B const& b) to return true if a < b and false otherwise
BinarySearch – std::true_type to use binary search within internal and leaf nodes, std::false_type to use linear search. linear search is typically faster for value types, but binary search is likely to be faster if comparing two keys requires an indirection or if the nodes are exceptionally large.
Public Types
-
template<typename Parent, auto internal_size>
using InternalNode = typename Detail::template InternalNode<Parent, internal_size>
Public Static Functions
-
static inline constexpr size_t sizeof_hint()
-
template<typename Parent>
struct Persistent : public Parent -
Public Functions
-
inline GetValue operator[](Key const &key) const
-
inline GetValue operator[](Key const &key) const
Public Functions
- Returns:
an iterator pointing to the element with key ‘key’
- Returns:
a const_iterator pointing to the element with key ‘key’
- Returns:
a const_iterator pointing to the element with key ‘key’
- Returns:
an iterator pointing to the first element with a key >= ‘key’
- Returns:
a const_iterator pointing to the first element with a key >= ‘key’
- Returns:
a const_iterator pointing to the first element with a key >= ‘key’
- Returns:
an iterator pointing to the first element with a key >= ‘key’
- Returns:
a const_iterator pointing to the first element with a key > ‘key’
- Returns:
a const_iterator pointing to the first element with a key > ‘key’
- Returns:
true if this tree contains an element with key ‘key’, false otherwise