vendredi 5 janvier 2018

strongly typed enum - `class` keyword optional?

In 'modern' C++ that suppports strongly typed enums: is the class keyword optional?

I saw code that defines enums like:

enum SomeEnum: unsigned int {
    VAL1 = 0,
    VAL2 = 1,
    // ...
};

Is this a different thing, a sloppyness of the compiler (VS 2015 (MSVC 19)) or is the class keyword implicit if the enum is strongly typed?

Aucun commentaire:

Enregistrer un commentaire