BTreeIndex

public struct BTreeIndex<Key: Comparable, Value>

An index into a collection that uses a B-tree for storage.

BTree indices belong to a specific tree instance. Trying to use them with any other tree instance (including one holding the exact same elements, or one derived from a mutated version of the original instance) will cause a runtime error.

This index satisfies Collection’s requirement for O(1) access, but it is only suitable for read-only processing – most tree mutations will invalidate all existing indexes.

See also

BTreeCursor for an efficient way to modify a batch of values in a B-tree.
  • Return true iff a is equal to b.

    Declaration

    Swift

    public static func ==(a: BTreeIndex, b: BTreeIndex) -> Bool
  • Return true iff a is less than b.

    Declaration

    Swift

    public static func <(a: BTreeIndex, b: BTreeIndex) -> Bool