I have the following class
public class classB : classA
which contains function dostuff
Now I have a class SUPER
, which has an instance of B amongst its variables
classB SUPER_B;
and that has a 'redefinition' of 'dostuff' amongst its methods. Basically, what I need is that when classB calls 'dostuff', it does not call its internal dostuff, but SUPER's dostuff implementation instead.
Substantially, I would need that, on SUPER's initialization, classB's 'dostuff' be replaced with SUPER's dostuff.
It'd sort of make sense if there was a way to retrieve B's 'dostuff''s reference, but I don't know how to achieve that.
I've looked into virtual and Func, but they seem to require that SUPER be a derivate of B