This documentation is archived and is not being maintained.

6.2.2 Explicit enumeration conversions

Visual Studio .NET 2003

The explicit enumeration conversions are:

  • From sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, or decimal to any enum-type.
  • From any enum-type to sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, or decimal.
  • From any enum-type to any other enum-type.

An explicit enumeration conversion between two types is processed by treating any participating enum-type as the underlying type of that enum-type, and then performing an implicit or explicit numeric conversion between the resulting types. For example, given an enum-type E with and underlying type of int, a conversion from E to byte is processed as an explicit numeric conversion (Section 6.2.1) from int to byte, and a conversion from byte to E is processed as an implicit numeric conversion (Section 6.1.2) from byte to int.

Show: