Closed turol closed 11 months ago
It's just an array by design, with automatically conversion enum -> index
enum class Count : uint32_t {
One, Two, Three
};
std::array<uint32_t, std::string> notEnough =
{
"one", "two"
};
notEnough[(uint32_t)Count::One] = ....;
This code raises neither warnings nor errors on GCC or clang:
This makes it hard to add new values to enum since the compiler doesn't complain.