|
|
|
|
|
by randomdata
772 days ago
|
|
> Source? To which language? > `enum` is a "true" enum, while an `enum class` somehow isn't? No. Enums are used in both cases. The difference there is in the types the enums are applied to. In one case, a basic integer-based type. In the other, a class. This differs from Rust. Rust does not use enums. It relies on the type itself to carry all the information. C++ enum classes could have done the same, so it is not clear why they chose to use enums, but perhaps for the sake of familiarity or backwards compatibility with the regular enum directive? |
|
I mean more in the sense of "where did you get this definition from."
> The difference there is in the types the enums are applied to. In one case, a basic integer-based type. In the other, a class.
I'm still not seeing a difference, mainly because when I went to see how c++'s `enum class` and rust's `enum`, they both seemed to work the same.
vs