ok i have two class let's call them, ClassWorking and TemplateClass, they are not related in any way. Is there a way to say, i want the functiun "TemplateGenerate" from my TemplateClass now to behave like the func "generate" from my class ClassWorking.
Like a (this functiun does not exist) SetFunctiunBehavior(&templateClassRef->templateGenerate, &classWorkingRef->generate)
i know i can use functiun pointer to make TemplateClass receive a pointer and call it in the class, but that not what i want.
It's more something like a LD_Preload, to replace the inner of functiun without having to re-write it and without hinerit from a class who has it.
Hope i'm clear, and sorry if i made some ortographic error :)
Aucun commentaire:
Enregistrer un commentaire