A
Alex
If I have something like:
class foo {
enum X { a, b, c };
};
Then I'd expect to use the enum this way: X::a . Instead, I have to use
foo::a
Why is this? doesn't the enum create a 'scope' by itself?
The problem is that if I had
class foo {
enum X { a, b, c };
enum Y { x, y, z };
};
Then using foo::a or foo::z don't specify their proper 'type'... so I don't
see any advantage of encapsulating this in the enum...
any reason for this? (I'm beginner, so bear with me)
Thanks.
class foo {
enum X { a, b, c };
};
Then I'd expect to use the enum this way: X::a . Instead, I have to use
foo::a
Why is this? doesn't the enum create a 'scope' by itself?
The problem is that if I had
class foo {
enum X { a, b, c };
enum Y { x, y, z };
};
Then using foo::a or foo::z don't specify their proper 'type'... so I don't
see any advantage of encapsulating this in the enum...
any reason for this? (I'm beginner, so bear with me)
Thanks.