Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Enumerations

enum MyEnum {
    A,
    B,
}

Enumerations are defined in enum blocks, which name the enumeration and define a list of items inside curly braces. The items are syntactically identifiers and should be unique within the enumeration. Duplicate items is a compile error.

The type of an enumeration is enum ❮name❯. See also the Enumerations type for usage information.