+ 6
Importance of enum class
What is use of enum class ? I know that it makes enum element as strong cast and we cannot use the element of enum without class name i.e. enum name... but what is use case of this? any problem has been solved by this or what is the advantages for doing the same functionality?
2 odpowiedzi
+ 2
There are two reasons I used them.
1. enum class does not propagate enumerators outside of its scope, so there is no name clashing.
2. You are able to forward its declaration.
If you wanna read more I'd recommend this answer:
https://stackoverflow.com/a/18338930
+ 1
Talisman this in not the answer to the question. Btw. we got const keyword for constant values