I am getting a warning:
error: deleting object of abstract class type ‘Converter::ConversionImpl’ which has non-virtual destructor will cause undefined behavior [-Werror=delete-non-virtual-dtor]
delete it->second;
^~~~~~
That is causing me a few difficulties in solving. I've tried applying virtual, but I suspect this has something more to do with the map, which is a multimap and I can't seem to find an alternative to the virtual delete operator. In fact all my research suggests that this is in fact the right way to do it, if a little non-standard. (None of the research examples were a match for what is actually being done here).
typedef multimap<int,ConversionImpl*> ConversionImplList;
struct CRegistry {
ConversionImplList list;
CRegistry();
~CRegistry()
{
for (ConversionImplList::iterator it=list.begin(); it!=list.end(); ++it)
{
delete it->second;
}
list.clear();
}
};
Why is it throwing up the issue with second and not with the destructor as a whole and where would be the best place to find materials that would cover this scenario?
Code in Full (Not the best work in the world I agree, I'm still getting my head around everything). Converter.h
Edit
The solution to this one is indicated in a comment below and refers to a class declared in an associated header not in the file itself. The key here is to look at the wording of the warning message carefully because the words mean specific things.
In this case the class up one, failed to declare the destructor to be "virtual". In all likelihood, when a similar error comes up this is likely to be the cause.