If I have a code:
struct Parent
{
virtual void fn();
};
struct Child : public Parent
{
virtual void fn() override final
{
Parent::fn();
}
};
There is a way to have Parent::fnbe finalonly when accessing through Childwithout re-implementation fn, so that some others classcan override fnon output Parent, but not on exit Child?
as:
struct Child : public Parent
{
virtual void fn() override final = Parent::fn;
};
or any other syntax?
source
share