Confused about search function
I have this search function that has a prototype of:
Node<T>* search(const T& key, bool (*match)(const T&,const T&));
where:
• key is a reference to the thing that we are searching for
• match is the address of a function that will return true if its second argument "matches" the first and false otherwise. You may assume that at most one node will "match" the key. just call it to compare key against a value in the node)
• the function returns the address of the node that matches if it is found, NULL otherwise.
• if item is found, the list will need to be adjusted so that the found node is at the front of the list
The page can be found here on pastebin for the search function. It is searching for and finding 'key' in a doubly link list and it's supposed to bring it to the front of the node but this test program i have gives an error saying list was not properly adjusted after search. That's test 11 but it tests other functions before search. Please help!!
Full assignment can be found here:
C++ pastebin - collaborative debugging tool.
Thank you.