
On 08/21/09 17:28, Nicholas Howe wrote:
I have written a C++ Multimethod library and propose adding it to Boost. [snip]
The library works by requiring clients to register user types of interest, and specify their public base classes. This allows traversing class hierarchies at run-time. A multimethod uses this information to perform run-time overload resolution on registered methods to determine the best implementation based on the type-id of each parameter. There are no restrictions on the types of a multimethod's parameters, although only single indirections to user types will behave polymorphically. [snip]
Hi Nicholas, I haven't looked at your code, but the mention of "registered methods" in the above quote suggests some sort of time consuming lookup. I just uploaded to boost_vault/Patterns a text file: PescioNdispatch.txt This was written years about (aroung 2003) so I can't remember very well the details, but, IIRC, it uses some sort fo elaborate multiple inheiritance and maybe some casting to achieve the dispatch, but I think it just uses virtual methods. Anyway, it might be worth comparing with your method. -regards, Larry