S
shuisheng
Dear All,
I have a question on inheritance. Assume I have a base class Vector and
its derived class DecoratedVector as follows:
class Vector
{
// Constructors.
Vector();
Vector(size_t num, double initValue);
Vector(const double *pData, size_t num);
... // Other several constructors.
};
class DecoratedVector : public Vector
{
...
private:
size_t id;
};
The DecoratedVector is in fact a Vector with a decorated id. What I am
wondering is that if there is any way to ease the work of writing the
constructors for class DecoratedVector, since they are always the same
as those in class Vectors.
Thank you for your kind help!
Shuisheng
I have a question on inheritance. Assume I have a base class Vector and
its derived class DecoratedVector as follows:
class Vector
{
// Constructors.
Vector();
Vector(size_t num, double initValue);
Vector(const double *pData, size_t num);
... // Other several constructors.
};
class DecoratedVector : public Vector
{
...
private:
size_t id;
};
The DecoratedVector is in fact a Vector with a decorated id. What I am
wondering is that if there is any way to ease the work of writing the
constructors for class DecoratedVector, since they are always the same
as those in class Vectors.
Thank you for your kind help!
Shuisheng