Issue inheriting from a base template class

Hi all,

I have a template class (assembled as a double linked list requirement) which looks like an array with subscript operators, etc. I have the class receiving a data type of choice with an integer for the index. Now I am trying to create another class that will also take 2 arguments one of any data type and the index will be a string.

Versus just copy and pasting, I want to just inherit from the original and change methods that would change values, etc. Here is code snippets as to what I am trying to accomplish:

(Parent)
..
1
2
3
4
5
6
7
template <class DATA, class INDEX = int>
	class UBA
		{
		public:
		..
		private:
                ..


which works great and am trying:


1
2
3
4
5
6
7
8
9
10
template <class DATA, class INDEX = String>
class UBSA : public UBA <DATA, INDEX>
		{
	
		public:
		..
			
		private:
		..
		};>

Things break on this line:

class UBSA : public UBA <-- error that template parameter list is required
class UBSA : public UBA <DATA, INDEX> <-- generic syntax error

There is something I am missing and another pair of eyes would be appreciated,

Thanks!





template <class DATA, class INDEX = int>
You can't use "= int", and why do you want to use a template when you already know what type you are using for index?

I should try to remove that and than check if the errors still occur. ^^
If you really want to use INDEX as index type, use:
typedef INDEX int;
Topic archived. No new replies allowed.