If we define two C++ classes. One is:
abstract class A {
public:
enum E {F, G, H;}
};
Another is class B, and how I can use the enum E in class A then? Assuming both B and A are in the same namespace. I know in C# we can use something like:
A.E
directly, but seems that is not the case of C++.
In C++,
.and->are for accessing a member of this particular instance of anAobject.::is for accessing things in the scope of classA. This includes statics, enums, and function pointers.So in C++ you want
A::ForA::Gif you want enum value.for the enum type you do
A::EAlso to make the class abstract you provide a pure virtual function.