This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
class hirachy problem
Hello,
I've a questions c++ related :
I'm using a list of classes, which are based all on the same class. I cast
those children classes back into parant class for more easy transport.
class CAlpha
{
....
}
template <T_Any>
class CBetaT : public CAlpha
{
....
}
class CGamma
{
....
}
void main(void)
{
CAlpha* a = (CAlpha*)new CBeta<CGamma>;
}
Now I like to call a template function ( funcT(CBeta<T_Any> &b) ) but at
the point where I do this, I do not now anymore, which children class I
initialized.
I could test with a list of dynamic_cast<>.
Is there a more easy way to implement this ?
kind regards,
Krisitna Kratzenstein
--------------------------------------------
Kristian Kratzenstein
Gettorf
Kristian.Kratzenstein@KielNET.net
--------------------------------------------