Constructs a sorted list out from an array.
Constructs a sorted list out from a range.
Returns whether the set has the given element.
Returns whether the set has the given element. Intended for use with structs and classes that can interface with the type of T through the cmp and equal functions's overrides.
Returns the amount of elements found in the set.
Moves to the n-th position and returns the element of that position.
Returns the element at begin and increments the position by one.
Set operators. Enables math operations on sets, like unions and intersections. Could work on ranges in general as long as they implement some basic functions, like iteration.
Returns the n-th element.
Set operators.
Set operators.
Returns a slice from the list.
Decrements the back iteration position by one
Increments the front iteration position by one
Adds a new element while keeping the order intact.
Removes the n-th element while keeping the order intact. Returns the removed element.
Removes the element which is equal with the given one if the template is set to not allow duplicates. Intended for use with structs and classes that can interface with the type of T through the cmp and equal functions's overrides. Returns the removed element, or E.init if not found.
Removes the element which is equal with the given one if the template is set to not allow duplicates. Returns the removed element, or E.init if not found.
Looks up value a in the list, then returns the element equal with it. Returns E.init if not found. Intended for use with structs and classes that can interface with the type of T through the cmp and equal functions's overrides.
Looks up value a in the list, then returns the element equal with it. Returns null if not found. Intended for use with structs and classes that can interface with the type of T through the cmp and equal functions's overrides.
Looks up value a in the list, then returns a reference to the element equal with it. Throws an exception if not found. Intended for use with structs and classes that can interface with the type of T through the cmp and equal functions's overrides.
Returns a slice from the list, but the slicing is done by element. * Search is done in a way that if either cmp or equals is true to an element, its position will be chosen * for the slice.
Returns the index of the given element, or throws an ElementNotFoundException if not found.
Returns a copy of the underlying array.
Returns the element at the back.
Returns the element at the back. Note: This is recommended for elements ordered by a key, which is not modified through this function. Failure of doing so will ruin the sortedness of the array.
Returns true when the end of the list have been reached.
Returns the element at the front.
Returns the element at the front. Note: This is recommended for elements ordered by a key, which is not modified through this function. Failure of doing so will ruin the sortedness of the array.
Returns the length of the list.
Sets the reserve of the underlying array and returns the current reserve.
Returns a copy of this struct.
Implements a sorted list of type T. The container ensures that all of it's elements are ordered after any insertion. Has some optimization to stop searching after a given value has passed. cmp can set both the direction of the array, and what parameters should be tested. If allowDuplicates set false, the collection will act like a sorted set over an array, and won't allow any insertion of preexisting values.