llvm::EnumeratedArray

Fixed-size array indexed by values of a scoped enumeration.

Synopsis

Declared in <llvm/ADT/EnumeratedArray.h>

template<
    typename ValueType,
    typename Enumeration,
    Enumeration LargestEnum = Enumeration::Last,
    typename IndexType = int,
    IndexType Size = 1 + static_cast<IndexType>(LargestEnum)>
class EnumeratedArray;

Description

The array holds one element per enumerator from zero through LargestEnum (inclusive). Indexing uses the enumeration type rather than a raw integer.

Type Aliases

NameDescription
const_iterator Const iterator over the stored elements.
const_pointer Const pointer to an element.
const_reference Const reference to an element.
const_reverse_iterator Const reverse iterator over the stored elements.
iterator Mutable iterator over the stored elements.
pointer Mutable pointer to an element.
reference Mutable reference to an element.
reverse_iterator Mutable reverse iterator over the stored elements.
value_type Element type stored in the array.

Member Functions

NameDescription
EnumeratedArray [constructor]Constructors
begin begin overloads
empty Return true if the array has zero elements.
end end overloads
operator[] Subscript operators
rbegin rbegin overloads
rend rend overloads
size Return the number of elements in the array.

Template Parameters

NameDescription
ValueTypeElement type stored in the array.
EnumerationScoped enum used as the index type.
LargestEnumLast enumerator; determines the array size.
IndexTypeUnderlying integer type used for indexing and size.
SizeNumber of elements (defaults to LargestEnum + 1).