我正在尝试从模板化的基类模板化一个子类,稍后将指定该子类。但是出现错误
test.C: In constructor ‘myDeri<U>::myDeri()’:
test.C:30:16: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]
test.C:35:5: error: expected ‘{’ before ‘~’ token
仅从以下
#include <iostream>
using namespace std;
// Base class
template<typename U>
class myBase // base class to be derived
{
public:
myBase(){}
~myBase() {}
};
template<typename U>
class myDeri : public myBase<U> // as i know, this should be Template derived class, Template base class case
{
public:
myDeri() : myBase<U> {}
~myDeri() {}
};
int main()
{
return (0);
}