dimanche 22 février 2015

why is the default type of enum class different than the underlying type of enum?

I am asking why the following code yields an error in Visual Studio 2014 update 4.



enum A
{ a = 0xFFFFFFFF };

enum class B
{ b = 0xFFFFFFFF };


I know that I can use enum class B : unsigned int. But why is the default underlying type of enum different that the default underlying type of enum class? There should be a design decision.


Aucun commentaire:

Enregistrer un commentaire