Based on your input, the target language is C++. Here is the translation of the provided example in Markdown format suitable for Hugo.
Enumerated types (enums) in C++ are a special case of sum types. An enum in C++ is a type with a fixed number of possible values, each associated with a distinct name.
Our enum type ServerState is defined as follows:
In C++, enum values are implicitly converted to int, but C++ offers stronger type-checking compared to some other languages. You have to explicitly cast int to ServerState if needed.
To run the program, compile the C++ code and then execute the binary:
This gives you an overview of how enums can be used effectively in C++. Now that you understand the basics, you can explore more features of the language.