enum types are an easy and efficient way to make an integer type without all the overhead of something like a
class or even a
struct. They’re basically a synonym for an integer type like
int. However, that “basically” hides a lot of details that affect the way you can work with them. Today’s article explores the arithmetic and operators you are and aren’t allowed to use when you opt for an
enum over an
int so you’ll have a better understanding of how and how not to use them.
Posts Tagged arithmetic