I want to make a simple wrapper B
around a complex class A
. A
has many different constructors. The class B
does not have any constructors, so how can I automatically pass the constructor arguments to the base class A
, without needing to implement them all in B
?
Here is a simple example of what I want to do:
class A
{
public:
A(int a);
A(const& A);
// etc ...
};
class B : public A
{
int b;
};
void main()
{
B b(0); // Since B does not have a constructor, I want it to dispatch to A::A(int)
}
note: A is a class from some package so I can not simply add my int b
to A
.