Why this compiles in c++11:
struct foo
{
enum class Resolution { None=10, Nominal=20 };
enum class Scale { None, Nominal };
};
while this doesn't:
struct foo
{
enum Resolution { None=10, Nominal=20 };
enum Scale { None, Nominal };
};
?
Why this compiles in c++11:
struct foo
{
enum class Resolution { None=10, Nominal=20 };
enum class Scale { None, Nominal };
};
while this doesn't:
struct foo
{
enum Resolution { None=10, Nominal=20 };
enum Scale { None, Nominal };
};
?
Before C++11 enum values were unscoped, meaning, that values in 2 enums can't be same.
This is no longer the case when using enum class.