Answers are grounded in this paper and cite their sources.
Global virtual functions (GVFs) are introduced as C++ functions defined at global or namespace scope which can be redefined later similar to virtual member functions. Even though GVFs are a relatively simple concept, hardly more complex than ordinary C functions, it is shown that they subsume object-oriented single, multiple, and predicate-based method dispatch as well as aspect-oriented before, after, and around advice. Furthermore, the well-known "expression problem" can be solved in a simple and natural way. Local virtual functions are a straightforward extension of GVFs allowing temporary redefinitions during the execution of some other function or part of it. Amongst others, this is quite useful to simulate "cflow join points" of aspect-oriented languages. The implementation of global and local virtual functions by means of a precompiler for C++ is briefly described.
No takes yet. Share an insight, caveat, or question.
Christian Heinlein (2005) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: