Template function error

I've recently been creating a binary search tree for a set but can't get the inorder function to work can someone point out the error and explain why i got it wrong apart from me being a complete newbie to C++.

The code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//Student register Program
#include "stdafx.h"
#include <iostream>
#include <cstdlib> 

using namespace std;

template <typename DT> //templates are used for flexibillty 
class studentRegister
{
    private:
        struct Node
        {
           Node * left;
           Node * right;
           DT data;
        };
        Node * root;
    
    public:
        studentRegister()
        {
           root = NULL;
        }
       
        bool isEmpty() const { return root==NULL; } //inline function
        void insert(DT);
		void remove(DT);
		void inorder(DT);

        
       
};

template <typename DT>
void studentRegister::inorder(DT p)
{
	if (p!=NULL)
	{
		inorder(p->left);
		cout<<p->data<<"-->";
		inorder(p->right);
	}
}


errors:
------ Build started: Project: assignment, Configuration: Debug Win32 ------
Compiling...
setTemp.cpp
settemp.h(36) : error C2955: 'studentRegister' : use of class template requires template argument list
settemp.h(10) : see declaration of 'studentRegister'
settemp.h(44) : error C2244: 'studentRegister<DT>::inorder' : unable to match function definition to an existing declaration
settemp.h(29) : see declaration of 'studentRegister<DT>::inorder'
definition
'void studentRegister::inorder(DT)'
existing declarations
'void studentRegister<DT>::inorder(DT)'
settemp.h(240) : error C2244: 'studentRegister<DT>::inorder' : unable to match settemp.h(29) : see declaration of 'studentRegister<DT>::inorder'
definition
'void studentRegister::inorder(DT)'
existing declarations
'void studentRegister<DT>::inorder(DT)'


Thanks in advance
1
2
3
template <typename DT>
void studentRegister<DT>::inorder(DT p)
{
spotted the error, thanks
Topic archived. No new replies allowed.