![]() end noteĪn enum declaration that does not explicitly declare an underlying type has an underlying type of int.ĭeclares an enum with an underlying type of long. Note: The char type cannot be used as an underlying type, either by keyword or via an integral_type_name. The integral_type_name is resolved in the same way as type_name ( §7.8.1), including taking any using directives ( §13.5) into account. The underlying type may be specified either by an integral_type ( §8.3.5), or an integral_type_name. ![]() The underlying type shall be one of the integral types ( §8.3.6) other than char. If the enum_base is present, it explicitly declares the underlying type. This underlying type shall be able to represent all the enumerator values defined in the enumeration. : type_name // Shall resolve to an integral type other than charĮach enum type has a corresponding integral type called the underlying type of the enum type. ![]() : attributes? enum_modifier* 'enum' identifier enum_base? enum_body ' '? An enum declaration begins with the keyword enum, and defines the name, accessibility, underlying type, and members of the enum. An enum type is a distinct value type ( §8.3) that declares a set of named constants.ĭeclares an enum type named Color with members Red, Green, and Blue.Īn enum declaration declares a new enum type. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |