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

Name

Description

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

Name

Description

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

Name

Description

ValueType

Element type stored in the array.

Enumeration

Scoped enum used as the index type.

LargestEnum

Last enumerator; determines the array size.

IndexType

Underlying integer type used for indexing and size.

Size

Number of elements (defaults to LargestEnum + 1).

Created with MrDocs