O
Old Wolf
enum class Foo
{
fooBar
};
int main()
{
Foo::fooBar; // ok
fooBar; // error
}
Is there any directive I can issue that will make the line marked
"error"
correct - i.e. make the members of the enum valid identifiers in the
current namespace?
The reason is that the enum definition is in an auto-generated header,
and the auto-generating program has been updated to now use
scoped enums where previously it used plain enums. I would like
to avoid having to add the prefix to every instance that an enum value
is
used in the codebase (and also preferably not change the
auto-generated code, as it would mean reapplying the change
each time the code is refreshed).
{
fooBar
};
int main()
{
Foo::fooBar; // ok
fooBar; // error
}
Is there any directive I can issue that will make the line marked
"error"
correct - i.e. make the members of the enum valid identifiers in the
current namespace?
The reason is that the enum definition is in an auto-generated header,
and the auto-generating program has been updated to now use
scoped enums where previously it used plain enums. I would like
to avoid having to add the prefix to every instance that an enum value
is
used in the codebase (and also preferably not change the
auto-generated code, as it would mean reapplying the change
each time the code is refreshed).