Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: template class derived from non-template base class

Reply
Thread Tools

Re: template class derived from non-template base class

 
 
Matt Graham
Guest
Posts: n/a
 
      07-21-2003
"Chris Theis" <(E-Mail Removed)> wrote in message news:<bf6jk1$ku9$(E-Mail Removed)>...
> "Matt Graham" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
>
> > 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.

Thanks
Matt
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
base class public type (non template and template base class) Hicham Mouline C++ 1 04-20-2009 03:28 PM
Help getting to a derived class template given a pointer to a no-template base class chris.kemmerer@att.net C++ 7 09-28-2007 01:55 AM
Derived::Derived(const Base&) and Derived& operator=(const Base&) developereo@hotmail.com C++ 1 05-23-2007 01:44 PM
Derived::Derived(const Base&) and Derived& operator=(const Base&) developereo@hotmail.com C++ 1 05-23-2007 12:07 AM
Type names defined in base template class not visible in derived class in gcc3.2? James Ying C++ 2 10-28-2003 11:36 PM



Advertisments