|
|
|
|
|
by Leherenn
2297 days ago
|
|
You can assign integers to enum in C++, just like in C, but not to enum class.
Use the latter when you need type safety, the former when you need to easily convert integer <-> enum, which apart from (de)serialisation is rare in my experience. And even in those cases, I personally prefer the explicit casts. As far as I know, MSVC just implements the C subset of C++. |
|
> As far as I know, MSVC just implements the C subset of C++.
There are things that work in MSVC C mode that do not work in C++ mode.