A factory‐backed mutable view of an immutable set.

Synopsis

Declared in <llvm/ADT/ImmutableSet.h>

template<
    typename ValT,
    typename ValInfo = ImutContainerInfo<ValT>,
    bool Canonicalize = true>
class ImmutableSetRef;

Description

Add and remove go through the associated factory without canonicalizing after each operation.

Type Aliases

Name

Description

FactoryTy

The factory type used to allocate and update tree nodes.

TreeTy

The underlying AVL tree type.

iterator

Iterator yielding stored set elements in in‐order.

value_type

The type of a stored set element.

value_type_ref

A reference to a stored set element.

Member Functions

Name

Description

ImmutableSetRef [constructor]

Construct from tree root R and factory F.

Profile

Profiles this set for folding‐set hashing.

add

Returns a new set containing all elements of this set plus V.

asImmutableSet

Converts this mutable view to an ImmutableSet, canonicalizing the root when Canonicalize is true.

begin

Returns an iterator to the first element in in‐order traversal.

contains

Returns true if the set contains the specified value.

end

Returns the end iterator for in‐order traversal.

getHeight

Returns the height of the AVL tree (0 if empty).

getRootWithoutRetain

Returns the tree root without changing its reference count.

isEmpty

Return true if the set contains no elements.

isSingleton

Return true if the set contains exactly one element. This method runs in constant time.

remove

Returns a new set containing all elements of this set except V.

validateTree

Checks that the AVL balancing and ordering invariants hold for this set.

operator==

Compares two sets for structural equality (contents, not pointer identity).

operator!=

Compares two sets for structural inequality.

Static Member Functions

Name

Description

Profile

Profiles S for folding‐set hashing (hashes the root pointer).

getEmptySet

Returns an empty set reference backed by factory F.

Created with MrDocs