L
lou zion
hi all,
i'm trying to use a classes enums in another class, but can't seem to find
the right syntax.
i've got class A which has:
enum EditTypeA {Currency, Percent, LabeledNumber, Text};
EditTypeA LineType; // LineType holds widget type, and will be either
Currency, Percent, LabeledNumber or Text
and i have class B with no enums.
i'm defining class C which is not a subclass of either A or B, but uses
classes from both. however, class B is almost exactly like class A except it
has this B widget in it, so i want all of the functionality of A in C.
one of the functions in A is
EditTypeA A::GetLineType() const {};
i want C to have the exact same function with the same output type
EditTypeA, but the following produces a syntax error for relatively obvious
reasons: (all header files have been included)
A::EditTypeA C::GetLineType() const {};
how can i get C to inherit all the enums from A. unfortunately subclassing
is not an option in this case.
thanks! lou
i'm trying to use a classes enums in another class, but can't seem to find
the right syntax.
i've got class A which has:
enum EditTypeA {Currency, Percent, LabeledNumber, Text};
EditTypeA LineType; // LineType holds widget type, and will be either
Currency, Percent, LabeledNumber or Text
and i have class B with no enums.
i'm defining class C which is not a subclass of either A or B, but uses
classes from both. however, class B is almost exactly like class A except it
has this B widget in it, so i want all of the functionality of A in C.
one of the functions in A is
EditTypeA A::GetLineType() const {};
i want C to have the exact same function with the same output type
EditTypeA, but the following produces a syntax error for relatively obvious
reasons: (all header files have been included)
A::EditTypeA C::GetLineType() const {};
how can i get C to inherit all the enums from A. unfortunately subclassing
is not an option in this case.
thanks! lou