mardi 3 octobre 2017

Is there a less blunt way of bring base class methods into a child class?

Consider

struct Base
{
    int foo(int);
    int foo(int, int);
};

struct Child : Base
{
    using Base::foo;
    int foo(int, int, int);
};

Ideally I want to bring the Base class foo that takes only one int as a parameter into the Child class, and not the one that takes 2 ints. Is there a way I can do that? My writing using Base::foo; brings in both foo methods of Base.

Aucun commentaire:

Enregistrer un commentaire