Hi all! I have a class, let's call it A. It has a enum (E) and a method Foo(E e), with gets E in the arguments. I want to write a wrapper (decorator) W for A. So it'll have its own method Foo(A::E). But I want to have some kind of encapsulation, so this method should defined as Foo(F f), where F is another enum defined in W, that can be converted to A::E. For example:
class A
{
public:
enum E { ONE, TWO, THREE };
void Foo(E e);
};
class B
{
//enum F; // ???
void Foo(F f)
{
a_.Foo(f);
}
private:
A a_;
};
How F should be defined? I don't want to copy value like this:
enum F { ONE = A::ONE, TWO = A::TWO, THREE = A::THREE };
because its a potential error in the near feature. Is the typedef definition:
typedef A::E F;
is the best decision? Is it legal?