Object-Orientation FAQ

4.3) Can I Use Multiple-Polymorphism Or Multi-Methods In C++?

Yes, but you'll need to embed a dynamic typing scheme to do it.  With dynamic
types in place, an overriding method in a derived class can explicitly check
argument types in a switch statement and invoke the desired method emulating
multiple-polymorphism [See Coplien 92].  
For true CLOS multi-methods, the above technique implemented as a base function
(CLOS defgeneric), switching to specialized functions (CLOS methods, made
friends of all arguments) will provide the functional calling syntax, multiple-
polymorphism and access to parameters found in CLOS.  This can require some
complex switching, which is somewhat mitigated when multiple-polymorphism
is implemented with virtual functions.
Future FAQs should contain more detail.

This document was translated by ms2html v1.8 on 01.06.95.