An immutable (persistent) ordered set backed by a reference‐counted AVL tree.
Synopsis
Declared in <llvm/ADT/ImmutableSet.h>
template<
typename ValT,
typename ValInfo = ImutContainerInfo<ValT>,
bool Canonicalize = true>
class ImmutableSet;
Description
Copying an ImmutableSet is cheap: it shares the underlying tree nodes. Updates go through Factory and return a new set while leaving the old one unchanged. When Canonicalize is true, structurally equal sets from the same factory share the same root pointer.
Types
Name |
Description |
Factory for creating and updating immutable sets. |
Type Aliases
Name |
Description |
The underlying AVL tree node type. |
|
Iterator over set elements in ascending key order. |
|
The type of a stored set element. |
|
A reference to a stored set element. |
Member Functions
Name |
Description |
|
Construct from tree root |
Profiles this set for folding‐set hashing. |
|
Returns an iterator to the first element in in‐order traversal. |
|
Returns true if the set contains the specified value. |
|
Returns the past‐the‐end iterator for in‐order traversal. |
|
Returns the height of the AVL tree (0 if empty). |
|
Returns the tree root with an extra retain for the caller. |
|
Returns the tree root without changing its reference count. |
|
Return true if the set contains no elements. |
|
Return true if the set contains exactly one element. This method runs in constant time. |
|
Checks that the AVL balancing and ordering invariants hold for this set. |
|
Returns true if this set and |
|
Compares two sets for inequality. For a canonicalizing factory this is an O(1) pointer comparison; otherwise it is a structural comparison. |
Static Member Functions
Name |
Description |
Profiles |
Friends
Name |
Description |
Factory for creating and updating immutable sets. |
Created with MrDocs