Do you use singular or plural for enumerations? I think it makes best sense with plural in the declaration
enum Weekdays
{
Monday,
Tuesday,
Wednesday
In general, I consider an enum definition to be a type definition, with the values of the enum being the different values the type can have; therefore it gets a singular name:
enum Weekday { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY };
enum CoffeeSize { SMALL, MEDIUM, LARGE };
Yes. If you do the mental experience of implementing the enums as classes, then the fact that you'd use a singular name for the type should reveal that it makes sense to use singular names for such enums . E.g.,
struct Weekday {};
const Weekday SUNDAY;
const Weekday MONDAY;
const Weekday TUESDAY;
...
void func (Weekday *day)
{
if (day == &SUNDAY)
...
}
For who prefers plurals in enums, would you name that struct Weekdays
?