Afficher un message
Vieux 17/10/2007, 18h53   #2
VirGin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Method In Templated Super/Parent Called From Templated Derived/Child

Hola Folks,

I have a class template (or template class, depending on how one was
taught). I have a class that is derived from the template class. I
have a method in the parent that is overloaded in the child. If the
child is unable to process the data being operated on, I want it to
either return control to the parent or call the parent's version of
the method. Since templates are involved, I'm unsure of the best way
of doing this. What are some of the ways of doing this?

Wow, that isn't clear at all.


Parent Class:
template <typename DrvdCls> class TheParentClass
{
void TheMethod(void);
...
template <typename DrvdCls> inline void
TheParentClass<DrvdCls>::TheMethod(void)
{
blah.. blah
}
}

Derived Class:
class TheKid:public TheParentClass<TheKid>
{
void TheMethod(void);
}

Using the above format, I want to call TheParentClass::TheMethod from
within TheKid::TheMethod.

Does that make sense? If so, what are different ways I could
accomplish this.

BTW, the way I did it the first time generated a 'requires template
argument list' error

anyway, thanx in advance


-V-

  Réponse avec citation
 
Page generated in 0,06045 seconds with 9 queries