Open utterances-bot opened 2 years ago
Is static_cast
EnumType(int) and int(enumerator) will both do a static cast in this case. I admit that explicitly writing "static_cast" would be a bit clearer - I think I might change it in the examples. FYI see the rules for such a "functional cast expression" on cppreference: https://en.cppreference.com/w/cpp/language/explicit_cast
C++ Enumerations Introduction | hacking C++
A short introduction to enumeration types in C++. Also compares classic C-style enums and modern
https://hackingcpp.com/cpp/lang/enumerations.html