Wouldn't it be nice if we could do something like this:
class Funky{
public: auto virtual void doStuff(){
// dostuff
}
};
class MoreFunky: public Funky{
public: void doStuff(){
// do more stuff
}
};
class AdvancedFunky: public MoreFunky{
public: void doStuff(){
// do advanced stuff
}
};
main(){
AdvancedFunky f;
f.doStuff();
}
Now, call to *auto virtual* member doStuff() should follow the same
logic as a constructor call in inheritance chain, i. e. when calling
f.doStuff() we got all doStuff() functions executed from bottom up:
Funky::doStuff( )
MoreFunky::doSt uff()
AdvancedFunky:: doStuff()
I think this feature could save us a lot of headache.
class Funky{
public: auto virtual void doStuff(){
// dostuff
}
};
class MoreFunky: public Funky{
public: void doStuff(){
// do more stuff
}
};
class AdvancedFunky: public MoreFunky{
public: void doStuff(){
// do advanced stuff
}
};
main(){
AdvancedFunky f;
f.doStuff();
}
Now, call to *auto virtual* member doStuff() should follow the same
logic as a constructor call in inheritance chain, i. e. when calling
f.doStuff() we got all doStuff() functions executed from bottom up:
Funky::doStuff( )
MoreFunky::doSt uff()
AdvancedFunky:: doStuff()
I think this feature could save us a lot of headache.
Comment