Hello, I have an "abstract" template header file that I am extending with another header file. I want to implement the methods from the abstract class in the extending class header file. One is called List and the other is called LinkedList, which is the implementation of List. What should the method headers look like for, say, an add method that takes a generic parameter?
C++ Template syntax question
Collapse
X
-
-
Ok, thanks. So if i am including the header I am extending and publicly extend that class by doing something like
should that be fine? Do I need to declare a generic type on List? I'm sorry... I'm fluent in Java and C but still learning nuances of C++ and writing my first program using templates... kind of jumped in the deep end.Code:template class<T> class LinkedList: public List
The problem so far is I'm getting a compiler error "expected class-name before ‘{’ token" and I don't know where that's coming from.Comment
Comment