S
srdgame
Below is my testing code, and it won't be compiled successfully, unless
you uncomment the "virtual void f(){}".
I wanna to know is this required by C++ Standard, or just because of GCC?
struct A
{
//virtual void f(){}
};
template <class T>
struct TA : public A
{
T _t;
};
int main()
{
A* a = new TA<int>();
TA<int>* ta = dynamic_cast< TA< int >* >(a);
delete a;
}
thanks
srdgame
you uncomment the "virtual void f(){}".
I wanna to know is this required by C++ Standard, or just because of GCC?
struct A
{
//virtual void f(){}
};
template <class T>
struct TA : public A
{
T _t;
};
int main()
{
A* a = new TA<int>();
TA<int>* ta = dynamic_cast< TA< int >* >(a);
delete a;
}
thanks
srdgame