vendredi 30 juin 2017

Avoid cast while comparing enum class with int

I finally convinced my co-worker to use enum class instead of the old enum.

However, when comparing int to a enum class value a cast is necessary now. At least IntelliSense says so:

enter image description here

Because of that unecessary cast (since the underlying type is int) she now wants to stay with the old enum...

Please help me out with arguments in that discussion. Maybe there is a technical way to avoid the cast?

Aucun commentaire:

Enregistrer un commentaire