enum

A value type that defines a fixed set of named constants, such as enum Status { Pending, Shipped, Delivered }.

In more detail

Each named constant has an underlying integer value, starting from 0 by default. Switch expressions over an enum are checked for exhaustiveness, so adding a member flags every switch that ignores it.

Related terms

Taught in

References