mercredi 5 août 2015

How can you alias a member function in another class?

Suppose I have two classes A and B,

class A
{
public:
    void print(int & m){
        cout<<"Inside class A m="<<m<<endl;
    }
};

class B
{
public:
   using print = A::print; // how do you achieve this ?
};

in class B I want to delegate the print function to the print in class A, someone can explain how to do this?

Aucun commentaire:

Enregistrer un commentaire