An inheriting class with a user-defined copy constructor must call its base class's copy constructor.
class BaseCopy {
public:
BaseCopy() = default;
BaseCopy(const BaseCopy &) = default;
};
class TheDerivedOne : public BaseCopy {
// BaseCopy(D) is missing
TheDerivedOne(const TheDerivedOne &D) {}
};
Or
class IDeriveToo : public BaseCopy {
// D is missing
IDeriveToo(const IDeriveToo &D) : BaseCopy() {}
};
class BaseCopy {
public:
BaseCopy() = default;
BaseCopy(const BaseCopy &) = default;
};
class TheDerivedOne : public BaseCopy {
// BaseCopy(other) is missing
TheDerivedOne(const TheDerivedOne &D) : BaseCopy(D) {}
};