lundi 18 mars 2019

ambiguous overloaded function differs only by argument's template parameter

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" ?

Aucun commentaire:

Enregistrer un commentaire