Templated Classes...Oy.

Started by
20 comments, last by Normie 22 years, 2 months ago
Sorry, guys, but I gotta bring up another question...

Is there anything I need to remember when inheriting from templated classes? My head hurts too much thinking about it... :-(

-Normie
I am a devout follower of the"Lazy Programmer's Doctrime"(tm)...and I'm damned proud of it, too!-----"I came, I saw, I started makinggames." ... If you'll excuseme, I must resume my searchfor my long lost lobotomy stitches.
Advertisement
I don''t think so...

You can inherit from a template in two ways - you can inherit its ''templatiness'', in which case the inherited class is also a template and subject to the same restrictions, or you can inherit from a specific instantiation of the template, in which case it behaves as a normal class from then on.

  template < class T >class blah{   // blah stuff here}// inherit as a general templatetemplate < class T >class yadda : public blah<T>{  // yadda stuff here}// Inherit from a specific typeclass whaffle : public blah<int>{  // whaffle stuff here}  



This topic is closed to new replies.

Advertisement