Consider the following code:
SmartPointer<Data> Fix(SmartPointer<Data> data)
{
return { /* Fixed Data */ };
}
SmartPointer<Data> Fix(SmartPointer<DataWrapper> dataWrapper)
{
return Fix(dataWrapper->Data());
}
How would I rewrite this so that it does not cause "error C2668: ambiguous call to overloaded function" ?
Note: I would like to be able to pass in a subclass for example SmartPointer<SubclassOfDataWrapper>
as well, and have that resolve to the overloaded function of the superclass.