Re: template class derived from non-template base class

Discussion in 'C++' started by Matt Graham, Jul 21, 2003.

  1. Matt Graham

    Matt Graham Guest

    "Chris Theis" <> wrote in message news:<bf6jk1$ku9$>...
    > "Matt Graham" <> wrote in message
    > news:...
    > > Now, whenever I call d1.x(), it runs B::y() instead of D::y().
    > >
    > > Is deriving a template class from a class without templates forbidden
    > > in C++?

    > No, this is perfectly legal. In principle your code should run just fine.
    > > Is it possibly a compiler support issue?
    > >

    > What compiler are you using and can you post some more code.

    Thanks to those who responded. I decided it must be a compiler issue
    and ended up trying a few work arounds before finding one that I
    should have tried some time ago.

    Sorry about posting code that couldn't be compiled. I'll note that for
    next time and not be so concerned about brievity. My actual code
    compiled fine and ran fine right up until it called the base class
    virtual member function instead of the derived class virtual member.

    The compiler I am using is CodeWarrior 9 for PalmOS. I guess I'll
    check out a related newsgroup to see if that's a known problem.

    Matt Graham, Jul 21, 2003
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page