I'm trying to understand if is possible to call a parent's function member from a child class.
Basically I have the following code:
struct Parent
{
template<class... Args>
void doFoo(Args&&... args)
{
std::cout << "parent doFoo";
}
template<class... Args>
void foo(Args&&... args)
{
doFoo(args...);
}
};
struct Child : Parent
{
template<class... Args>
void doFoo(Args&&... args)
{
std::cout << "child doFoo";
}
};
Child c;
c.foo(); // This should invoke Child::doFoo()
Is there a simple way to obtain "child doFoo" as output without introducing overhead?