mardi 1 décembre 2015

cannot use protected member of parent class in std::bind [duplicate]

I have class A and B:

class A
{
protected:
    void someFunc() {};
};

class B : public A
{
public:
    B()
    {
         auto a = std::bind(&A::someFunc, this);
    }
};

Why I cannot use bind for protected method someFunc? It should be accessible as I bind it with this.

Aucun commentaire:

Enregistrer un commentaire