Vector that assigns a sequential base‐1 ID to each unique entry.

Synopsis

Declared in <llvm/ADT/UniqueVector.h>

template<class T>
class UniqueVector;

Description

T is the type of entries in the vector. T should have implementations of operator== and of operator<. Entries can be fetched using operator[]with the entry ID.

Type Aliases

Name

Description

VectorType

Underlying contiguous storage of unique entries in insertion order.

const_iterator

Const iterator over the stored entries.

iterator

Mutable iterator over the stored entries.

Member Functions

Name

Description

begin

Return an iterator to the start of the vector.

empty

empty ‐ Returns true if the vector is empty.

end

Return an iterator to the end of the vector.

idFor

idFor ‐ return the ID for an existing entry. Returns 0 if the entry is not found.

insert

insert ‐ Append entry to the vector if it doesn't already exist. Returns the entry's index + 1 to be used as a unique ID.

operator[]

operator[]‐ Returns a reference to the entry with the specified ID.

reset

reset ‐ Clears all the entries.

size

size ‐ Returns the number of entries in the vector.

Created with MrDocs