Why does my C++ subclass need an explicit constructor?
问题 I have a base class that declares and defines a constructor, but for some reason my publicly derived class is not seeing that constructor, and I therefore have to explicitly declare a forwarding constructor in the derived class: class WireCount0 { protected: int m; public: WireCount0(const int& rhs) { m = rhs; } }; class WireCount1 : public WireCount0 {}; class WireCount2 : public WireCount0 { public: WireCount2(const int& rhs) : WireCount0(rhs) {} }; int dummy(int argc, char* argv[]) {