My C++ is basic but improving and I am trying to use a C++-based development kit (SDK) for some image processing software. The documentation and support for the SDK is limited.
The SDK provides a linked list class and I am keen to utilise this. The class allows me to remove nodes within the list but provides no functions for deleting the data pointed to by the node - that is my responsiblity.
As I intend to have a lot of linked lists, it strikes me as judicious to write my own delete function, rather than have to loop through each list in turn to delete the nodes and the pointed-to data and prevent leaks.
However, in order to do this, I need to pass the type of the data pointed to by the nodes in the list to my function. Is there any way of doing this? Or, is this impossible - hence there being no data delete function with the SDK's class?
I suspect this problem has been addressed before, but part of my problem is that I don't know what phrases to use to search for it. All my searches have come up with rudimentary explanations of linked lists, etc.
Izzy