Suppose we have an enum class:
enum class E
{
constant
};
To refer to the enumerator in E, we can write E::constant
, while the following is illegal:
E e;
e.constant;
But consider this:
struct S
{
enum {constant};
};
Both S::constant
and s.constant
are legal, wouldn't it be more consistent to allow e.constant
for an enum class? Is the inability intentional?