Help with function declaration error
I am working on a project for NACHOS (an OS for learning in C++)
I am implementing a compare function based on a list template.
The declaration for the compare function is in the header file and is as follows:
// function for sorting list elements
int (*compare)(T x, T y);
I have written the function and my declaration in the .cc file as follows:
When I compile in Linux I get the following error:
template <class T>
(*SortedList<T>::compare)(T x, T y)
error : invalid function declaration
I am a little stifled as to what I'm doing wrong... I am new to programming with templates in this capacity and some help would be great. Thank you very much!