I got classes below:
enum class Kind {
Monday,
Tuesday,
};
class Day {
public:
Day(Kind kind) : kind_(kind) {}
private:
Kind kind_;
};
class Tuesday : public Day, public std::vector<int> {
public:
Tuesday(...) : std::vector<int>(...), Day(Kind::Tuesday) {}
};
As you can see, even the Tuesday class inherit from Day, it calls Day(Kind::Tuesday)
, so the constructor forms of Tuesday
should be the same with std::vector<int>
But even the constructor form is the same, I have to re-write all the constructors to match the constructors of std::vector<int>
, and append Day(Kind::Tuesday)
to the end of each constructor.
All I want is to use Tuesday
as a vector. So I just curious if there's an easy way to do this?