Inheritance and Template Classes

This is a discussion on Inheritance and Template Classes within the C++ Programming forums, part of the General Programming Boards category; Would anyone mind posting some links over how to inherit using template classes? Long story short, I'm working on a ...

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    2

    Inheritance and Template Classes

    Would anyone mind posting some links over how to inherit using template classes?

    Long story short, I'm working on a program required to inherit some template classes but I'm kind of stuck at some compiler errors. It's a little too long to post(as there are five header files and one C++ file) and 3 days of Googling hasn't produced much in results...

    If you get a chance to, I'd really appreciate it. My book is a little murky.

  2. #2
    -bleh-
    Join Date
    Aug 2010
    Location
    somewhere in this universe
    Posts
    458
    Then post the error.
    "All that we see or seem
    Is but a dream within a dream." - Poe

  3. #3
    Registered User inequity's Avatar
    Join Date
    Nov 2010
    Location
    Seattle, Washington
    Posts
    59
    Let me google that for you

    What's the error?

  4. #4
    template<typename T> threahdead's Avatar
    Join Date
    Sep 2002
    Posts
    214
    Code:
    template<typename T>
    class Base
    {
    public:
        Base(void) {};
        ~Base(void) {};
    };
    
    template<typename T>
    class Derived : public Base<T>
    {
    // ...
    };
    I think, thats what you meant, no?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with classes and inheritance!!
    By alacahzam in forum C++ Programming
    Replies: 9
    Last Post: 03-18-2011, 12:39 PM
  2. Multiple inheritance from same base template ambiguity
    By TotalTurd in forum C++ Programming
    Replies: 6
    Last Post: 12-09-2010, 03:40 AM
  3. Replies: 5
    Last Post: 04-15-2009, 03:47 PM
  4. Inheritance + Template
    By audinue in forum C++ Programming
    Replies: 5
    Last Post: 07-20-2008, 01:51 AM
  5. Template and Inheritance
    By Unregistered in forum C++ Programming
    Replies: 4
    Last Post: 04-18-2002, 02:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21