Constructor. Pass in an array of elements, or individual elements to initialize the tree with.
Constructor. Pass in a range of elements to initialize the tree with.
Element type for the tree
The range types for RedBlackTree
Insert a range of elements in the container. Note that this does not invalidate any ranges currently iterating the container.
The last element in the container
Removes all elements from the container.
Get a range from the container with all elements that are == e according to the less comparator
The front element in the container
Get a range from the container with all elements that are < e according to the less comparator
in operator. Check to see if the given element exists in the container.
Compares two trees for equality.
Fetch a range that spans all the elements in the container.
Removes the given range from the container.
Removes the given Take!Range from the container
Remove an element from the container and return its value.
Remove the back element from the container.
Remove the front element from the container.
Removes elements from the container that are equal to the given values according to the less comparator. One element is removed for each value given which is in the container. If allowDuplicates is true, duplicates are removed only if duplicate values are given.
Insert a single element in the container. Note that this does not invalidate any ranges currently iterating the container.
Insert a range of elements in the container. Note that this does not invalidate any ranges currently iterating the container.
Generates a hash for the tree. Note that with a custom comparison function it may not hold that if two rbtrees are equal, the hashes of the trees will be equal.
Formats the RedBlackTree into a sink function. For more info see std.format.formatValue. Note that this only is available when the element type can be formatted. Otherwise, the default toString from Object is used.
Get a range from the container with all elements that are > e according to the less comparator
Duplicate this container. The resulting container contains a shallow copy of the elements.
Check if any elements exist in the container. Returns false if at least one element exists.
Returns the number of elements in the container.
Implementation of a red-black tree container.
All inserts, removes, searches, and any function in general has complexity of O(lg(n)).
To use a different comparison than "a < b", pass a different operator string that can be used by std.functional.binaryFun, or pass in a function, delegate, functor, or any type where less(a, b) results in a bool value.
Note that less should produce a strict ordering. That is, for two unequal elements a and b, less(a, b) == !less(b, a). less(a, a) should always equal false.
If allowDuplicates is set to true, then inserting the same element more than once continues to add more elements. If it is false, duplicate elements are ignored on insertion. If duplicates are allowed, then new elements are inserted after all existing duplicate elements.