Hello,
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:
Code:
int (*compare)(T x, T y);
// function for sorting list elements
I have written the function and my declaration in the .cc file as follows:
Code:
template <class T>
int
(*SortedList<T>::compare)(T x, T y)
{
}
When I compile in Linux I get the following error:
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!
Best regards,