C
Chu Zhou
Hi, all here is my code:
template<class T>
class TBase
{
public:
typedef int Int;
struct TItem
{
T Data;
};
int value;
};
template<class T>
class TClassublic TBase<T>
{
public:
void func()
{
TBase<T>::value ++;
}
};
int main(int argc, char *argv[])
{
TClass<int> obj;
return 0;
}
In VC and Borland C++ compiler, they both can compile it. But gcc
cannot compile it because it use two times to deal with template
things. VC or BCB do not care unknown template name. Is there any way
to suppress this function of gcc? Thank you!
template<class T>
class TBase
{
public:
typedef int Int;
struct TItem
{
T Data;
};
int value;
};
template<class T>
class TClassublic TBase<T>
{
public:
void func()
{
TBase<T>::value ++;
}
};
int main(int argc, char *argv[])
{
TClass<int> obj;
return 0;
}
In VC and Borland C++ compiler, they both can compile it. But gcc
cannot compile it because it use two times to deal with template
things. VC or BCB do not care unknown template name. Is there any way
to suppress this function of gcc? Thank you!