我试图创建一个成员对象(希望这个终点是正确的)并且它有效。但是,如果我派生对象的类,它就会失败。为什么会这样,我该如何解决这个问题?
class test
{
protected:
int id;
public:
test(){};
~test() {};
test(int a){};
};
/* Without Comments it doesn't work
class derivtest : public test
{
protected:
int id;
public:
derivtest(){};
~derivtest() {};
derivtest(int a){};
}
*/
class test2
{
public:
test2():teil(){};
private:
test teil;
};