mardi 5 février 2019

How to do function overloading with std::shared_ptr

I basically want to do the following,

class C {
    public:
    void F(std::shared_ptr<void>);
    void F(std::shared_ptr<SOME_OTHER_CLASS>);
};

However, when I compile and I try to use the function with std::shared_ptr<void> I get an error like:

call of overloaded F(...) is ambiguous

How may I solve this?

Aucun commentaire:

Enregistrer un commentaire